<!DOCTYPE html>
<html lang='zh-CN'>
<link href="/assets/projects/application-5f0a70e1ce9688abf44238b1eae7c778.css" media="screen" rel="stylesheet" type="text/css" />
<head>
<meta charset='utf-8'>
<meta content='IE=edge' http-equiv='X-UA-Compatible'>
<meta content='码云,代码托管,git,Git@OSC,gitee.com,开源,项目管理,版本控制,开源代码,代码分享,项目协作,开源项目托管,免费代码托管,Git代码托管,Git托管服务' name='Keywords'>
<meta content='码云(gitee.com)是开源中国社区团队推出的基于Git的快速的、免费的、稳定的在线代码托管平台,不限制私有库和公有库数量' name='Description'>
<title>
drawbackground.cpp · B16041616/B16041616李浩铭 - 码云 Gitee.com
</title>
<link href="/assets/favicon-950947d692935bf7e0b1629a69cd89ed.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
<meta content='gitee.com/B16041616/B16041616LiHaoMing git https://gitee.com/B16041616/B16041616LiHaoMing.git' name='go-import'>
<link href="/assets/application-4242cbbe3b213edca3aee068c3d357d7.css" media="screen" rel="stylesheet" type="text/css" />
<script src="/assets/application-47479d6be234364e19ac8ee10f303aa7.js" type="text/javascript"></script>
<script src="/assets/lib/jquery.timeago.zh-CN-bcd91c2c27a815fa9a395595874b592b.js" type="text/javascript"></script>

<meta content="authenticity_token" name="csrf-param" />
<meta content="ReIQnSR30XO/ib0/vfIxL31i76Xc7P3JBGBokRPYcs4=" name="csrf-token" />
<script type="text/javascript">
//<![CDATA[
window.gon = {};gon.locale="zh-CN";gon.http_clone="https://gitee.com/B16041616/B16041616LiHaoMing.git";gon.user_project="B16041616/B16041616LiHaoMing";gon.message="B16041616";gon.manage_branch="\u7ba1\u7406\u5206\u652f";gon.manage_tag="\u7ba1\u7406\u6807\u7b7e";gon.enterprise_id=0;gon.ref="master";
//]]>
</script>
<script src="//res.wx.qq.com/open/js/jweixin-1.2.0.js" type="text/javascript"></script>
<script>
  var title = document.title.replace(/( - Gitee| - 码云)$/, ''),
    imgUrl = '',
    imgUrlEl = document.querySelector('meta[itemprop=image]')
  if (imgUrlEl) {
    imgUrl = imgUrlEl.getAttribute('content')
  } else {
    imgUrl = "https://gitee.com//logo_4wechat.png"
  }
  wx.config({
    debug: false,
    appId: "wxff219d611a159737",
    timestamp: "1514422936",
    nonceStr: "696250eaa25fd31db81c9800c982391b",
    signature: "f95fe2ac6bb0c01bb428c984c4c9a443840aa2a2",
    jsApiList: [
      'onMenuShareTimeline',
      'onMenuShareAppMessage'
    ]
  });
  wx.ready(function () {
    wx.onMenuShareTimeline({
      title: title, // 分享标题
      link: "https://gitee.com/B16041616/B16041616LiHaoMing/blob/master/drawbackground.cpp", // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
      imgUrl: imgUrl // 分享图标
    });
    wx.onMenuShareAppMessage({
      title: title, // 分享标题
      link: "https://gitee.com/B16041616/B16041616LiHaoMing/blob/master/drawbackground.cpp", // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
      desc: document.querySelector('meta[name=Description]').getAttribute('content'),
      imgUrl: imgUrl // 分享图标
    });
  });
</script>

<script type='text/x-mathjax-config'>
MathJax.Hub.Config({
  tex2jax: {
    inlineMath: [['$','$'], ['\\(','\\)']],
    displayMath: [["$$","$$"],["\\[","\\]"]],
    processEscapes: true,
    skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code', 'body'],
    processClass: "markdown-body"
  }
});
</script>
<script src="https://gitee.com/uploads/resources/MathJax-2.7.2/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script>

<!--[if lt IE 10]>
<script>
    window.location.href = "/incompatible.html";
</script>
<![endif]-->
</head>

<body class='git-project lang-zh-CN'>
<script src="/assets/projects/app-e8e80cfed4f65d217e3fc893175bdc1f.js" type="text/javascript"></script>
<header class='common-header fixed noborder' id='git-header-nav'>
<div class='ui container'>
<div class='ui menu'>
<div class='item gitosc-logo'>
<a href="/"><img class='ui inline image' height='28' src='/logo.svg?20171024' width='95'>
</a></div>
<a href="/explore/recommend" class="item " title="开源项目">开源项目
</a><a href="/gists" class="item " title="代码片段">代码片段
</a><a href="/enterprises" class="item " title="企业版">企业版
<sup class='ui red label'>
特惠
</sup>
</a><div class='dropdown item ui' id='my-gitee-dropdown'>
<a href="/TaoEr233/events">我的码云</a>
<i class='dropdown icon'></i>
<div class='menu'>
<div class='header user-enterprises'>
<a href="/TaoEr233/enterprises" class="pull-right" target="_blank">全部</a>
企业
<span class='count'></span>
</div>
<div class='disabled item tip'>
无企业
</div>
<div class='header user-groups'>
<a href="/TaoEr233/groups" class="pull-right" target="_blank">全部</a>
组织
<span class='count'></span>
</div>
<div class='disabled item tip'>
无组织
</div>
<div class='header user-projects'>
<a href="/TaoEr233/projects" class="pull-right" target="_blank">全部</a>
项目
<span class='count'></span>
</div>
<div class='disabled item tip'>
无项目
</div>
<div class='ui dimmer'>
<div class='ui loader'></div>
</div>
</div>
</div>
<div class='right menu userbar' id='git-nav-user-bar'>
<div class='item'>
<form accept-charset="UTF-8" action="/search" id="projects-search-form" method="get"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /></div>
<div class='ui mini fluid input'>
<input autocomplete="off" id="search_top-search-input" name="search" placeholder="搜索项目、代码片段..." type="text" />
<input id="group_id" name="group_id" type="hidden" />
<input id="project_id" name="project_id" type="hidden" value="2825930" />
<input id="type" name="type" type="hidden" />
</div>
</form>

<script>
  $('#projects-search').click(function(){
     $('#projects-search-form').submit();
  });
  $('#projects-search-form').submit(function(){
    query_name = $('#search_top-search-input').val();
    search_type = $('#type').val();
    var reg_exp = new RegExp('^\\*+$');
    if (query_name != undefined && $.trim(query_name).length < 1) {
      $('#search_top-search-input').focus();
      Flash.show("搜索关键字不能少于1个", 'error');
      return false;
    } else if (search_type == 'user' && reg_exp.test(query_name.replace(/\s/g, ''))) {
      Flash.show('搜索格式不正确', 'error');
      return false;
    }
  });
  
  // End
</script>

</div>
<div class='item ui dropdown empty' data-count-path='/notifications/unread_count' data-mark-notice-path='/notifications/mark' id='notice-dropdown'>
<a href="/notifications" class="remind-button"><i class='iconfont icon-remind'></i>
<div class='notice-count total'></div>
</a><div class='notice-dropdown-panel menu'>
<div class='notice-dropdown-panel-header'>
<div class='tab active' data-data-path='/notifications/notices?scope=referer' data-html-path='/notifications/referer' data-scope='referer'>
<div class='content'>
@ 我
<div class='notice-count referer'></div>
</div>
</div>
<div class='tab' data-data-path='/notifications/notices?scope=infos' data-html-path='/notifications/infos' data-scope='infos'>
<div class='content'>
通知
<div class='notice-count infos'></div>
</div>
</div>
<div class='tab' data-data-path='/notifications/notices?scope=messages' data-html-path='/notifications/messages' data-scope='messages'>
<div class='content'>
私信
<div class='notice-count messages'></div>
</div>
</div>
</div>
<div class='item notice-dropdown-panel-container'>
<div class='ui dimmer over active'>
<div class='ui loader'></div>
</div>
<div class='notice-list'></div>
<div class='notice-dropdown-panel-blank'>
暂没有新消息
</div>
</div>
<div class='notice-dropdown-panel-footer'>
<div class='action'>
<div class='side left'>
<a href="javascript: void(0);" class="mark-notices">全部标记为已读
</a></div>
<div class='side right'>
<a href="javascript: void(0);" class="load-all" target="_blank">查看全部
</a></div>
</div>
</div>
</div>
</div>

<div class='ui dropdown link item' id='git-nav-create'>
<i class='iconfont icon-add-circle'></i>
<div class='right menu'>
<a href="/projects/new" class="item"><i class='add square icon'></i>
新建项目
</a><a href="/TaoEr233/codes/new" class="item"><i class='code icon'></i>
发布代码片段
</a><a href="/organizations/new" class="item"><i class='group icon'></i>
创建组织
</a><a href="/create_enterprise" class="item"><i class='icon iconfont icon-enterprise'></i>
开通企业版
</a><a href="/projects/oauth_github" class="item"><i class='github icon'></i>
从 GitHub 导入项目
</a><a href="/projects/csdn_code" class="item"><i class='iconfont icon-logo_csdn icon'></i>
CODE 一键迁移
</a></div>
</div>
<div class='ui dropdown item' id='git-nav-user'>
<a href="/TaoEr233/events"><img avatar="TaoEr233" class="ui avatar image TaoEr233-avatar" />
</a><i class='dropdown icon'></i>
<div class='right menu'>
<a href="/TaoEr233/events" class="item"><div class='mayun-icon my-ic-user-home my-ic-user-home-dims'></div>
个人主页
</a><a href="/profile" class="item"><div class='mayun-icon my-ic-edit my-ic-edit-dims'></div>
设置
</a><div class='divider'></div>
<a href="/logout" class="item destroy-user-session" data-method="delete" rel="nofollow"><div class='mayun-icon my-ic-exit my-ic-exit-dims'></div>
退出
</a></div>
</div>
<script>
  $('.destroy-user-session').click(function() {
    $.cookie('access_token', null, { path: '/' });
  })
</script>

</div>
</div>
</div>
</header>
<style>
  .git-annual-report-mark{top:20px;right:-80px;width:200px;height:100px;z-index:99;position:fixed;color:#fff !important;background-color:#FE7300;-webkit-transform:rotate(45deg);transform:rotate(45deg);text-align:center;padding:25px 0 0 0}.git-annual-report-mark .btn-close{font-size:24px}.git-annual-report-mark .btn-close:hover{opacity:.8}.git-annual-report-mark .btn-close:active{opacity:.6}.git-annual-report-mark:hover{background-color:#ff8119}.git-annual-report-mark:active{background-color:#e56700}
</style>
<a href="/2017annual" class="git-annual-report-mark" id="annual-report-mark"><span class='btn-close'>
&times;
</span>
<br>
码云2017
<br>
<strong>
年度报告
</strong>
</a><script>
  (function() {
    $('#annual-report-mark').on('click', '.btn-close', function(e) {
      e.preventDefault();
      $.cookie('hide_annual_report', '1', {
        expires: 31,
        path: '/'
      });
      return $(this).parent().remove();
    });
  
  }).call(this);
</script>
<script>
  (function() {
    var $header, initMyGiteeDropdown;
  
    $header = $('#git-header-nav');
  
    $header.find('.userbar .ui.dropdown').dropdown({
      on: 'hover',
      action: 'nothing',
      onShow: function() {
        return $(this).parent().addClass('active');
      },
      onHide: function() {
        return $(this).parent().removeClass('active');
      }
    });
  
    initMyGiteeDropdown = function() {
      var $dimmer, $dropdown, isLoaded, isLoading, loadData, renderList;
  
      isLoaded = false;
      isLoading = false;
      $dropdown = $('#my-gitee-dropdown');
      $dimmer = $dropdown.find('.ui.dimmer');
      renderList = function(target, data) {
        var $target, count, html, item, name, _i, _ref, _results;
  
        count = data[target + '_count'];
        $target = $dropdown.find('.header.user-' + target);
        if (count < 1) {
          $target.find('a.pull-right').remove();
          return;
        }
        $target.find('.count').text('(' + count + ')');
        $target.next().remove();
        _ref = data[target + '_list'];
        _results = [];
        for (_i = _ref.length - 1; _i >= 0; _i += -1) {
          item = _ref[_i];
          name = htmlSafe(item.name);
          html = ['<a target="_blank" href="', item.url, '" title="', name, '" class="item">', name, '</a>'].join('');
          _results.push($target.after(html));
        }
        return _results;
      };
      loadData = function() {
        if (isLoaded || isLoading) {
          return;
        }
        isLoading = true;
        $dimmer.addClass('active');
        $(this).parent().addClass('active');
        return $.getJSON('/api/v3/internal/my_resources', function(data) {
          $dimmer.removeClass('active');
          renderList('enterprises', data);
          renderList('projects', data);
          renderList('groups', data);
          isLoading = false;
          return isLoaded = true;
        });
      };
      $dropdown.dropdown({
        on: 'hover',
        action: 'nothing',
        onShow: loadData,
        onHide: function() {
          return $(this).parent().removeClass('active');
        }
      });
      return loadData();
    };
  
    initMyGiteeDropdown();
  
    $header.find('.ui.enterprises.dropdown').dropdown({
      on: 'hover',
      action: 'nothing'
    });
  
  }).call(this);
</script>
<script>
  (function() {
    var updateNavbar;
  
    updateNavbar = function() {
      if (window.scrollY > 5) {
        return $('#git-header-nav').addClass('floating');
      } else {
        return $('#git-header-nav').removeClass('floating');
      }
    };
  
    updateNavbar();
  
    $(window).on('scroll', updateNavbar);
  
  }).call(this);
</script>
<script>
  var emailStatus, commentStatus, gotopStatus;
  
  var c_start;
  c_start = document.cookie.indexOf("remote_way=");
  if (c_start == -1) {
    setCookie('remote_way', "http", 360);
  }
  function setCookie(c_name, value, expiredays) {
    var exdate = new Date();
    exdate.setDate(exdate.getDate() + expiredays);
    document.cookie = c_name + "=" + escape(value) + ((expiredays == null) ? "" : ";expires = " + exdate.toGMTString()) + ("; path = /");
  }
</script>

<!--[if lt IE 10]>
<script>
  window.location.href = "/incompatible.html"
</script>
<![endif]-->

<div class='fixed-notice-messages'>
<div class='ui hide green message' id='project-ok-msg'>
私信发送成功
</div>
<div class='ui container'>
<div class='flash-messages' id='messages-container'></div>
</div>
</div>
<script>
  (function() {
    $(function() {
      var $error_box, notify_content, notify_options, setCookie, template;
  
      template = '<div data-notify="container" class="ui {0} message" role="alert">' + '<i data-notify="dismiss" class="close icon"></i>' + '<span data-notify="message">{2}</span>' + '</div>';
      notify_content = null;
      notify_options = {};
      $error_box = $(".flash_error.flash_error_box");
      if (notify_options.type === "error" && $error_box.length > 0 && !$.isEmptyObject(notify_content.message)) {
        $error_box.html(notify_content.message).show();
      } else if (notify_content) {
        notify_options.delay = 3000;
        notify_options.template = template;
        notify_options.offset = {
          x: 10,
          y: 30
        };
        notify_options.element = '#messages-container';
        $.notify(notify_content, notify_options);
      }
      setCookie = function(name, value) {
        $.cookie(name, value, {
          path: '/',
          expires: 365
        });
      };
      return $('#remove-bulletin').on('click', function() {
        setCookie('remove_bulletin', "gitee-maintain-1514185369");
        $('#git-bulletin').hide();
      });
    });
  
  }).call(this);
</script>

<div class='git-project-header'>
<div class='fixed-notice-messages'>
<div class='ui info icon floating message green' id='fetch-ok' style='display: none'>
<div class='content'>
<div class='header status-title'>
<i class='info icon status-icon'></i>
代码拉取完成，系统将自动刷新
</div>
</div>
</div>
</div>
<div class='ui container'>

<div class='git-project-header-details'>
<div class='git-project-header-actions'>
<span class='ui basic buttons'>
<a class='ui button donate' id='project-donate' title='捐赠'>
<i class='iconfont icon-donation'></i>
捐赠
</a>
<a class='ui button social-count' href='/B16041616/B16041616LiHaoMing#project-donate-overview'>0</a>
<div class='ui small modal project-donate-modal'>
<div class='content'>
项目的主人没有开启捐赠功能，快通知他让他开启吧！
<a id='send-message-to-author'>
&ensp;&ensp;
发送私信 &gt;&gt;
</a>
</div>
<div class='actions' id='modal-act'>
<div class='message'>
</div>
<div class='buttons'>
<div class='ui green cancel button'>
关闭
</div>
</div>
</div>
</div>
<div class='ui small modal wepay-qrcode'>
<div class='header'>
扫描微信二维码支付
<span class='wepay-cash'></span>
</div>
<div class='content weqcode-center'>
<img id='wepay-qrcode' src=''>
</div>
<div class='actions'>
<div class='ui negative button'>取消</div>
<div class='ui button positive right'>
支付完成
</div>
</div>
</div>
</span>
<script>
  (function() {
    var $btnSubmit, $dimmer, $fieldManualCash, $modal;
  
    $modal = $('.project-donate-modal');
  
    $dimmer = $modal.find('.dimmer');
  
    $modal.find('.radio.checkbox').checkbox({
      fireOnInit: true
    });
  
    $fieldManualCash = $modal.find('input[name="manual_cash"]').parents('.field');
  
    $modal.find('input[name="ensure_cash"]').on('change', function() {
      var $this;
  
      $this = $(this);
      $this.parents('.card-fields').find('.checked').removeClass('checked');
      $this.parent().addClass('checked');
      if ($this.val() === 'manual') {
        return $fieldManualCash.show();
      } else {
        return $fieldManualCash.hide();
      }
    });
  
    $('#btn-cancel-donate').on('click', function() {
      return $modal.modal('hide');
    });
  
    $btnSubmit = $modal.find('.ui.pay.button').on('click', function() {
      var $msg, $name, $payType, cash, data, msgReg, nameReg, token;
  
      msgReg = /.{4,256}/;
      nameReg = /.{2,36}/;
      $msg = $modal.find('[name="msg"]');
      $name = $modal.find('[name="name"]');
      $payType = $modal.find('input[name="pay_type"]:checked');
      token = $modal.find('meta[name="csrf-token"]').attr('content');
      cash = $modal.find('input[name="ensure_cash"]:checked').val();
      if (cash === 'manual') {
        cash = $('#manual_cash').val();
      }
      if (isNaN(cash) || cash < 1 || cash > 50000) {
        $('#manual_cash').parent().addClass('error');
        return;
      }
      data = {
        msg: $msg.val(),
        name: $name.val(),
        cash: cash,
        authenticity_token: token
      };
      $('#manual_cash').parent().removeClass('error');
      if (!nameReg.test(data.name)) {
        $name.parent().addClass('error');
        return;
      }
      $name.parent().removeClass('error');
      if (!msgReg.test(data.msg)) {
        $msg.parent().addClass('error');
        return;
      }
      $msg.parent().removeClass('error');
      $dimmer.addClass('active');
      $btnSubmit.addClass('disabled').prop('disabled', true);
      if ($payType.val() === 'wepay') {
        $.ajax({
          url: '/B16041616/B16041616LiHaoMing/wepay',
          data: data,
          type: 'POST',
          success: function(data) {
            var base64data, money;
  
            if (data.result === 'fail') {
              alert('无法完成支付！原因：' + data.msg);
              window.location.reload();
              return;
            }
            money = data.money + ' 元';
            base64data = 'data:image/png;base64,' + data.data.base64QRCode;
            $('#wepay-qrcode').attr('src', base64data);
            $('.wepay-cash').text(money);
            $('.ui.modal.wepay-qrcode').modal('show');
            $btnSubmit.removeClass('disabled').prop('disabled', false);
            $dimmer.removeClass('active');
            return $modal.modal('hide');
          },
          error: function(xhr) {
            if (xhr.status === 401) {
              alert('需要先登录账号才能完成支付！');
              window.location.href = '/login';
              return;
            }
            return alert('无法完成支付，请过一段时间后再试！');
          }
        });
      } else {
        $.ajax({
          url: '/B16041616/B16041616LiHaoMing/alipay',
          data: data,
          type: 'POST',
          success: function(data) {
            if (data.result === 'fail') {
              alert('无法完成支付！原因：' + data.msg);
              window.location.reload();
              return;
            }
            document.write(data.data.html);
            $dimmer.removeClass('active');
            return $btnSubmit.removeClass('disabled').prop('disabled', false);
          },
          error: function(xhr) {
            if (xhr.status === 401) {
              alert('需要先登录账号才能完成支付！');
              window.location.href = '/login';
              return;
            }
            return alert('无法完成支付，请过一段时间后再试！');
          }
        });
      }
      return false;
    });
  
  }).call(this);
</script>

<span class='basic buttons ui watch-container watched'>
<a href="/B16041616/B16041616LiHaoMing/unwatch" class="ui button unwatch" data-method="post" data-remote="true" rel="nofollow"><i class='iconfont icon-watch'></i>
Unwatch
</a><a href="/B16041616/B16041616LiHaoMing/watch" class="ui button watch" data-method="post" data-remote="true" rel="nofollow"><i class='iconfont icon-watch'></i>
Watch
</a><a href="/B16041616/B16041616LiHaoMing/watchers" class="ui button social-count" title="4">4
</a></span>
<span class='basic buttons star-container ui'>
<a href="/B16041616/B16041616LiHaoMing/unstar" class="ui button unstar" data-method="post" data-remote="true" rel="nofollow"><i class='iconfont icon-star'></i>
Unstar
</a><a href="/B16041616/B16041616LiHaoMing/star" class="ui button star" data-method="post" data-remote="true" rel="nofollow"><i class='iconfont icon-star'></i>
Star
</a><a href="/B16041616/B16041616LiHaoMing/stargazers" class="ui button social-count" title="0">0
</a></span>
<span class='ui basic buttons fork-container'>
<a href="#" class="ui button fork" id="fork-top-button"><i class='iconfont icon-fork'></i>
Fork
</a><a href="/B16041616/B16041616LiHaoMing/members" class="ui button social-count" title="0">0
</a></span>
</div>
<h2 class='git-project-title'>
<span class="project-title"><i class="iconfont icon-project-public" title="这是一个公开项目"></i> <a href="/B16041616" class="author" title="B16041616">B16041616</a> / <a href="/B16041616/B16041616LiHaoMing" class="repository" style="padding-bottom: 0px" target="" title="B16041616李浩铭">B16041616李浩铭</a></span><span class="project-badges"><a href="/explore/recommend?lang=c-cpp" class="ui small label" id="project-language" target="_blank" title="主要编程语言">C/C++</a></span>
<input id="project_title" name="project_title" type="hidden" value="B16041616/B16041616李浩铭" />
</h2>
</div>
</div>
<div class='row' id='import-result-message' style='padding-top: 0px; display: none'>
<div class='sixteen wide column'>
<div class='ui icon yellow message status-color'>
<i class='info icon status-icon' style='width:60px;padding-right:12px;'></i>
<i class='close icon'></i>
<div class='header status-title'>
同步状态
</div>
<span class='status-message'></span>
</div>
</div>
</div>
<div class='ui small modal' id='modal-fork-project'>
<div class='close-button'>
<i class='icon-close iconfont'></i>
</div>
<div class='header left aligned'>
Fork 项目
</div>
<div class='content'>
<div class='fork-info-content'>
<div class='ui segment fork_project_loader'>
<div class='ui active inverted dimmer'>
<div class='ui text loader'>加载中</div>
</div>
</div>
</div>
</div>
<div class='actions fork-action hide'>
<a class='cancel'>&emsp;取消&emsp;</a>
<div class='ui large button orange ok'>&emsp;确认&emsp;</div>
</div>
</div>
<script>
  (function() {
    var $modalFork;
  
    this.title_project_path = 'B16041616LiHaoMing';
  
    this.title_fork_url = '/B16041616/B16041616LiHaoMing/sync_fork';
  
    $modalFork = $('#modal-fork-project');
  
    $('#fork-top-button').on('click', function(e) {
      e.preventDefault();
      $modalFork.modal('show');
      return setTimeout(function() {
        return $.ajax({
          url: "/B16041616/B16041616LiHaoMing/fork_project_info"
        });
      }, 500);
    });
  
    $('#modal-fork-project .close-button').on('click', function(e) {
      return $modalFork.modal('hide');
    });
  
  }).call(this);
</script>
<script>
  (function() {
    var $modalDonate;
  
    $('#modal-fork-project').modal({
      transition: 'fade'
    });
  
    $modalDonate = $('.project-donate-modal').modal({
      onApprove: function() {
        return false;
      }
    });
  
    if ("" === 'true') {
      $modalDonate.modal('show');
    }
  
    $('#project-donate').on('click', function() {
      return $modalDonate.modal('show');
    });
  
    $('#send-message-to-author').on('click', function() {
      $modalDonate.modal('hide');
      return $('#project-user-message').trigger('click');
    });
  
  }).call(this);
</script>
<style>
  i.loading {
    -webkit-animation: icon-loading 1.2s linear infinite;
    animation: icon-loading 1.2s linear infinite;
  }
  .qrcode_cs{
    float: left;
  }
</style>

<div class='git-project-nav'>
<div class='ui container'>
<div class='ui secondary pointing menu'>
<a href="/B16041616/B16041616LiHaoMing" class="item active"><i class='iconfont icon-code'></i>
代码
</a><a href="/B16041616/B16041616LiHaoMing/issues" class="item "><i class='iconfont icon-issue'></i>
Issues
<span class='ui mini circular label'>
0
</span>
</a><a href="/B16041616/B16041616LiHaoMing/pulls" class="item "><i class='iconfont icon-pull-request'></i>
Pull Requests
<span class='ui mini circular label'>
0
</span>
</a><a href="/B16041616/B16041616LiHaoMing/attach_files" class="item "><i class='iconfont icon-annex'></i>
附件
<span class='ui mini circular label'>0</span>
</a><a href="/B16041616/B16041616LiHaoMing/wikis" class="item "><i class='iconfont icon-wiki'></i>
Wiki
<span class='ui mini circular label'>
0
</span>
</a><a href="/B16041616/B16041616LiHaoMing/repository/stats/master" class="item "><i class='iconfont icon-statistics'></i>
统计
</a><div class='item'>
<div class='ui dropdown git-project-service'>
<div class='text'>
<i class='iconfont icon-service'></i>
服务
</div>
<i class='dropdown icon'></i>
<div class='menu'>
<a href="/B16041616/B16041616LiHaoMing/paas/select_platform" class="item">代码演示
</a><a href="/B16041616/B16041616LiHaoMing/quality_analyses/confirm_platform" class="item">质量分析
</a><a href="/B16041616/B16041616LiHaoMing/pages" class="item">Pages
</a></div>
</div>
</div>
</div>
</div>
</div>
<script>
  $('.git-project-nav .ui.dropdown').dropdown({ action: 'nothing' });
</script>
<style>
  .git-project-nav i.checkmark.icon {
    color: green;
  }
</style>
<script>
  $('#git-versions.dropdown').dropdown();
  $.ajax({
    url:"/B16041616/B16041616LiHaoMing/access/add_access_log",
    type:"GET"
  });
</script>

</div>
<div class='git-project-content-wrapper'>
<div class='ui container'>
<div class='git-project-content' id='git-project-content'>
<div class='row' id='git-detail-clone'>
<div class='git-project-desc-wrapper'>
<div class='git-project-desc'>
<span class='git-project-desc-text'>
<i>暂无描述</i>
</span>
<span class='git-project-homepage'>
</span>
</div>
<div class='ui form' id='description-edit' style='display:none;'>
<div class='fields'>
<div class='eight wide field'>
<div class='ui small input'>
<input id='desc-input' placeholder='描述' type='text' value=''>
</div>
</div>
<div class='four wide field'>
<div class='ui small input'>
<input id='url-input' placeholder='项目主页(eg: https://gitee.com)' type='text' value=''>
</div>
</div>
<button class='ui positive button' id='btn-save-desc'>
保存更改
</button>
<button class='ui button' id='btn-cancel-edit-desc'>
取消
</button>
</div>
</div>
</div>
<script>
  (function() {
    var $btnCancel, $btnSave, $description, $homepage, $textDescription, $textHomepage, description, homepage;
  
    $homepage = $('#url-input');
  
    $description = $('#desc-input');
  
    homepage = $('#url-input').val();
  
    description = $('#desc-input').val();
  
    $textHomepage = $('.git-project-homepage');
  
    $textDescription = $('.git-project-desc-text');
  
    $btnSave = $('#btn-save-desc');
  
    $btnCancel = $('#btn-cancel-edit-desc');
  
    $btnCancel.on('click', function() {
      $('#description-edit').hide();
      return $('.git-project-desc').show();
    });
  
    $('#btn-edit-desc').on('click', function() {
      $homepage.val(homepage);
      $description.val(description).focus();
      $('#description-edit').show();
      return $('.git-project-desc').hide();
    });
  
    $btnSave.on('click', function() {
      var newDescription, newHomepage, reg, url;
  
      reg = /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)/;
      url = '/B16041616/B16041616LiHaoMing/update_description';
      newDescription = $('#desc-input').val().trim();
      newHomepage = $('#url-input').val().trim();
      if (newHomepage && !reg.test(newHomepage)) {
        newHomepage = 'http://' + newHomepage;
      }
      $btnSave.addClass('disabled').prop('disabled', true);
      $btnCancel.addClass('disabled').prop('disabled', true);
      return $.post(url, {
        desc: newDescription,
        homepage: newHomepage
      }, function(data) {
        $btnSave.removeClass('disabled').prop('disabled', false);
        $btnCancel.removeClass('disabled').prop('disabled', false);
        if (data.status === -1) {
          alert('无权限操作!');
        } else if (data.status === 1) {
          description = newDescription;
          homepage = newHomepage;
          if (description) {
            $textDescription.text(description);
          } else {
            $textDescription.html('<i class="none">暂无描述</i>');
          }
          if (homepage) {
            $textHomepage.html('<a href="' + homepage + '" rel="nofollow">' + homepage + '</a>').show();
          } else {
            $textHomepage.hide();
          }
        } else if (data.status === 0) {
          alert('修改发生错误,请稍后重试!');
          return;
        } else {
          alert(data.status);
          return;
        }
        $('#description-edit').hide();
        return $('.git-project-desc').show();
      });
    });
  
  }).call(this);
</script>

</div>
<div class='ui horizontal hollow nopadding segments git-project-stats'>
<div class='ui segment center aligned'>
<a href="/B16041616/B16041616LiHaoMing/commits/master"><i class='iconfont icon-commit'></i>
<b id='commits_count'>11</b>
次提交
</a></div>
<div class='ui segment center aligned'>
<a href="/B16041616/B16041616LiHaoMing/branches"><i class='iconfont icon-branches'></i>
<b id='branches_count'>1</b>
个分支
</a></div>
<div class='ui segment center aligned'>
<a href="/B16041616/B16041616LiHaoMing/tags"><i class='iconfont icon-tag'></i>
<b id='tags_count'>0</b>
个标签
</a></div>
<div class='ui segment center aligned'>
<a href="/B16041616/B16041616LiHaoMing/releases"><i class='iconfont icon-release'></i>
<b id='releases_count'>0</b>
个发行版
</a></div>
<div class='ui segment center aligned'>
<a href="/B16041616/B16041616LiHaoMing/contributors?ref=master"><i class='iconfont icon-collaborators'></i>
<b id='collaborators_count'></b>
<span class='contributor_text'>
正在获取贡献者
</span>
</a></div>
</div>
<div class='git-project-bread' id='git-project-bread'>
<div class='ui right floated horizontal list'>
<div class='item'>
<div class='ui orange button' id='btn-dl-or-clone'>
克隆/下载
<i class='dropdown icon'></i>
</div>
</div>
</div>
<div class='ui horizontal list'>
<div class='item item git-project-branch-item'>
<input id="path" name="path" type="hidden" value="drawbackground.cpp" />
<div class='ui top left pointing dropdown gradient button' id='git-project-branch'>
<input id="ref" name="ref" type="hidden" value="master" />
<div class='default text'>
master
</div>
<i class='dropdown icon'></i>
<div class='menu'>
<div class='ui left icon search input'>
<i class='iconfont icon-search'></i>
<input placeholder='搜索分支或标签' type='text'>
</div>
<div class='header'><div class='pull-right'>
<a href="/B16041616/B16041616LiHaoMing/branches/recent">管理</a></div>分支 (1)</div>
<div class='scrolling menu'>
<div class='item' data-value='master'>master</div>
</div>
</div>
</div>
</div>
<div class='item'>
<div class='repo-index repo-none-index' style='margin-left:0px;'>
<div class='ui horizontal list repo-action-list'>
<div class='item'>
<a href="/B16041616/B16041616LiHaoMing/issues/new" class="ui gradient button repo-action">+ Issue</a>
</div>
<div class='item'>
<div class='ui pointing right top dropdown gradient button' id='git-project-file'>
<div class='text'>文件</div>
<i class='dropdown icon'></i>
<div class='menu'>
<div class='disabled item'>新建文件</div>
<div class='disabled item'>上传文件</div>
<a class='item repo-action' id='search-files'>
搜索文件
</a>
</div>
</div>
</div>
<div class='item'>
<a href="/B16041616/B16041616LiHaoMing/widget" class="ui gradient button repo-action">挂件
</a></div>
</div>
</div>
</div>
<div class='breadcrumb_path item' style='margin-left: 0; padding-left: 0'>
<div class='ui breadcrumb path' id='path-breadcrumb'>
<a href="/B16041616/B16041616LiHaoMing/tree/master" class="section repo-name" data-direction="back" style="font-weight: bold">B16041616LiHaoMing
</a><div class='divider'>
/
</div>
<strong>
drawbackground.cpp
</strong>
</div>

</div>
</div>
<div class='ui popup bottom right transition hidden git-project-download-panel'>
<div class='ui small secondary pointing menu'>
<a class='item active' data-type='http' data-url='https://gitee.com/B16041616/B16041616LiHaoMing.git'>HTTPS</a>
<a class='item' data-type='ssh' data-url='git@gitee.com:B16041616/B16041616LiHaoMing.git'>SSH</a>
</div>
<div class='ui fluid right labeled small input'>
<input id="project_clone_url" name="project_clone_url" onclick="focus();select()" readonly="readonly" type="text" value="https://gitee.com/B16041616/B16041616LiHaoMing.git" />
<div class='ui basic label'>
<div class='ui small basic orange button' data-clipboard-target='#project_clone_url' id='btn-copy-clone-url'>
复制
</div>
</div>
</div>
<hr>
<a href="/B16041616/B16041616LiHaoMing/repository/archive/master.zip" class="ui fluid tiny download link button"><i class='icon download'></i>
下载ZIP
</a><hr>
<a href='/enterprises?from=gitosc-project-ad'>
<div class='ent-poster project ver-3'>
<div class='carousel slide' data-interval='5000' data-ride='carousel'>
<div class='carousel-inner'>
<div class='item img-1 active'></div>
<div class='item img-2'></div>
<div class='item img-3'></div>
</div>
</div>
</div>
</a>
</div>
</div>
<style>
  .ui.dropdown .menu>.header{text-transform:none}
</style>
<script>
  $(document).ready(function () {
    var $contri_count = $('#collaborators_count')
    var $contri_text = $('.contributor_text')
    $.ajax({
      url: '/B16041616/B16041616LiHaoMing/contributors_count?ref=master',
      method: 'GET',
      success: function(data) {
        if (data.status === 1) {
          $contri_count.text(data.contributors_count);
          $contri_text.text('位贡献者')
        } else {
          $contri_text.text('获取失败')
        }
      }
    });
    var $tip = $('#apk-download-tip');
    if (!$tip.length) {
      return;
    }
    $tip.find('.btn-close').on('click', function () {
      $tip.slideUp();
    });
  });
  $('#git-project-branch').dropdown({
    fullTextSearch: true,
    onChange: function (value, text) {
      var path = $('#path').val();
      var href = ['/B16041616/B16041616LiHaoMing/tree', value, path].join('/');
      window.location.href = href;
    }
  });
  $('#git-project-file').dropdown({ action: 'hide' });
  (function(){
    function pathAutoRender() {
      var $parent = $('#git-project-bread'),
          $child = $('#git-project-bread').children('.ui.horizontal.list'),
          mainWidth = 0;
      $child.each(function (i,item) {
        mainWidth += $(item).width()
        });
      $('.breadcrumb.path.fork-path').remove();
      if (mainWidth > 995) {
        $('#path-breadcrumb').hide();
        $parent.append('<div class="ui breadcrumb path fork-path">' + $('#path-breadcrumb').html() + '<div/>')
      } else {
        $('#path-breadcrumb').show();
      }
    }
    window.pathAutoRender = pathAutoRender;
    pathAutoRender();
  })();
</script>
<script>
  (function() {
    var $btnCopy, $input, $item, $panel, clipboard, remoteWay;
  
    $input = $('#project_clone_url');
  
    remoteWay = 'http';
  
    clipboard = new Clipboard('#btn-copy-clone-url');
  
    $panel = $('.git-project-download-panel');
  
    $btnCopy = $('#btn-copy-clone-url');
  
    $panel.find('.menu > .item').on('click', function() {
      var $item;
  
      $item = $(this).addClass('active');
      $item.siblings().removeClass('active');
      $input.val($item.attr('data-url'));
      return setCookie('remote_way', $item.attr('data-type'), 360);
    });
  
    $('#btn-dl-or-clone').popup({
      popup: $panel,
      position: 'bottom right',
      on: 'click'
    });
  
    if (remoteWay) {
      $item = $panel.find('.item[data-type="' + remoteWay + '"]');
      if ($item.length === 0) {
        $item = $panel.find('.item[data-type="http"]');
      }
      $item.addClass('active').siblings().removeClass('active');
      $input.val($item.attr('data-url'));
    }
  
    clipboard.on('success', function() {
      $btnCopy.popup({
        content: '已复制',
        position: 'right center',
        onHidden: function() {
          return $btnCopy.popup('destroy');
        }
      });
      return $btnCopy.popup('show');
    });
  
    clipboard.on('error', function() {
      $btnCopy.popup({
        content: '复制失败，请手动复制',
        position: 'right center',
        onHidden: function() {
          return $btnCopy.popup('destroy');
        }
      });
      return $btnCopy.popup('show');
    });
  
  }).call(this);
</script>

<div class='row column tree-holder' id='tree-holder'>
<div class='tree-content-holder' id='tree-content-holder'>
<div class='file_holder'>
<div class='file_title'>
<div class='options'><div class='ui mini buttons basic'>
<textarea id="blob_raw" name="blob_raw" style="display:none;">
﻿// drawbackground.cpp: 定义控制台应用程序的入口点。&#x000A;//&#x000A;&#x000A;// draw.cpp: 定义控制台应用程序的入口点。&#x000A;//&#x000A;&#x000A;#include &quot;stdafx.h&quot;&#x000A;#include&lt;Windows.h&gt;&#x000A;&#x000A;bool g_hasBlocked[50][50];&#x000A;BOOL bCurTeris[4][4];&#x000A;BOOL bNextCurTeris[4][4];&#x000A;RECT rc_left, rc_right, rc_right_top, rc_right_bottom, rc_main;&#x000A;int NUM_X = 10;&#x000A;int NUM_Y = 20;&#x000A;int curPosX, curPosY;&#x000A;int BLOCK_SIZE = 30;&#x000A;int GAME_DIFF = 1;&#x000A;int GAME_SCORE = 0;&#x000A;const int BORDER_X = 10;&#x000A;const int BORDER_Y = 10;&#x000A;const int SCREEN_LEFT_X = 300 + BORDER_X;&#x000A;const int SCREEN_Y = 600 + BORDER_Y;&#x000A;const int SCREEN_RIGHT_X = 180 + BORDER_X * 2;&#x000A;const int SCREEN_X = SCREEN_LEFT_X + SCREEN_RIGHT_X;&#x000A;&#x000A;void drawNext(HDC hdc);&#x000A;void drawScore(HDC hdc);&#x000A;&#x000A;&#x000A;void drawBlocked(HDC mdc)//绘制当前已经存在砖块的区域&#x000A;{&#x000A;	int i, j;&#x000A;	//在应用程序调用CreateSolidBrush创建刷子以后，可以通过调用SelectObject函数把该刷子选入设备环境&#x000A;	HBRUSH hBrush = (HBRUSH)CreateSolidBrush(RGB(255, 255, 0));//画刷句柄，黄色&#x000A;&#x000A;	SelectObject(mdc, hBrush);//函数选择一对象到指定的设备上下文环境中，新对象替换先前的相同类型的对象&#x000A;&#x000A;	for (i = 0; i&lt;NUM_Y; i++)&#x000A;	{&#x000A;		for (j = 0; j&lt;NUM_X; j++)&#x000A;		{&#x000A;			if (g_hasBlocked[i][j])&#x000A;			{&#x000A;				Rectangle(mdc, BORDER_X + j*BLOCK_SIZE, BORDER_Y + i*BLOCK_SIZE,&#x000A;					BORDER_X + (j + 1)*BLOCK_SIZE, BORDER_Y + (i + 1)*BLOCK_SIZE&#x000A;				);//绘画矩形的函数，并用当前颜色的画刷进行颜色的填充&#x000A;			}&#x000A;		}&#x000A;	}&#x000A;	DeleteObject(hBrush);//该函数删除一个逻辑笔、画笔、字体、 位图、区域或者调色板，释放所有与该对象有关的系统资源&#x000A;}&#x000A;VOID DrawTeris(HDC mdc)&#x000A;{&#x000A;&#x000A;	int i, j;&#x000A;	HPEN hPen = (HPEN)GetStockObject(BLACK_PEN);//画笔句柄&#x000A;	HBRUSH hBrush = (HBRUSH)GetStockObject(WHITE_BRUSH);&#x000A;	SelectObject(mdc, hPen);//electObject是计算机编程语言函数，该函数选择一对象到指定的设备上下文环境中，新对象替换先前的相同类型的对象&#x000A;	SelectObject(mdc, hBrush);&#x000A;	for (i = 0; i&lt;4; i++)&#x000A;	{&#x000A;		for (j = 0; j&lt;4; j++)&#x000A;		{&#x000A;			if (bCurTeris[i][j])&#x000A;			{&#x000A;				Rectangle(mdc, (j + curPosX)*BLOCK_SIZE + BORDER_X, (i + curPosY)*BLOCK_SIZE + BORDER_Y, (j + 1 + curPosX)*BLOCK_SIZE + BORDER_X, (i + 1 + curPosY)*BLOCK_SIZE + BORDER_Y);&#x000A;			}&#x000A;		}&#x000A;	}&#x000A;	drawBlocked(mdc);&#x000A;	DeleteObject(hPen);&#x000A;	DeleteObject(hBrush);&#x000A;}&#x000A;&#x000A;VOID DrawBackGround(HDC hdc)//绘制背景&#x000A;{&#x000A;&#x000A;	HBRUSH hBrush = (HBRUSH)GetStockObject(GRAY_BRUSH);&#x000A;	//适用于支持光栅操作的设备，应用程序可以通过调用GetDeviceCaps函数来确定一个设备是否支持这些操作&#x000A;	HDC mdc = CreateCompatibleDC(hdc);&#x000A;	HBITMAP hBitmap = CreateCompatibleBitmap(hdc, SCREEN_X, SCREEN_Y);&#x000A;&#x000A;	SelectObject(mdc, hBrush);&#x000A;	SelectObject(mdc, hBitmap);&#x000A;&#x000A;	HBRUSH hBrush2 = (HBRUSH)GetStockObject(WHITE_BRUSH);&#x000A;	FillRect(mdc, &amp;rc_main, hBrush2);&#x000A;	Rectangle(mdc, rc_left.left + BORDER_X, rc_left.top + BORDER_Y, rc_left.right, rc_left.bottom);&#x000A;	Rectangle(mdc, rc_right.left + BORDER_X, rc_right.top + BORDER_Y, rc_right.right, rc_right.bottom);&#x000A;	DrawTeris(mdc);&#x000A;	drawNext(mdc);&#x000A;	drawScore(mdc);&#x000A;	::BitBlt(hdc, 0, 0, SCREEN_X, SCREEN_Y, mdc, 0, 0, SRCCOPY);&#x000A;	DeleteObject(hBrush);&#x000A;	DeleteDC(mdc);&#x000A;	DeleteObject(hBitmap);&#x000A;	DeleteObject(hBrush2);&#x000A;&#x000A;&#x000A;	//  int x,y;&#x000A;	//  HPEN hPen = (HPEN)GetStockObject(NULL_PEN);&#x000A;	//  HBRUSH hBrush = (HBRUSH)GetStockObject(GRAY_BRUSH);&#x000A;	//  SelectObject(hdc,hPen);&#x000A;	//  SelectObject(hdc,hBrush);&#x000A;	//  for (x = 0;x&lt;NUM_X;x++)&#x000A;	//  {&#x000A;	//      for(y=0;y&lt;NUM_Y;y++)&#x000A;	//      {&#x000A;	//          Rectangle(hdc,BORDER_X+x*BLOCK_SIZE,BORDER_Y+y*BLOCK_SIZE,&#x000A;	//              BORDER_X+(x+1)*BLOCK_SIZE,&#x000A;	//              BORDER_Y+(y+1)*BLOCK_SIZE);&#x000A;	//      }&#x000A;	//  }&#x000A;}&#x000A;&#x000A;void drawNext(HDC hdc)//绘制下一个将要掉落的方块&#x000A;{&#x000A;	int i, j;&#x000A;	HBRUSH hBrush = (HBRUSH)CreateSolidBrush(RGB(0, 188, 0));&#x000A;	SelectObject(hdc, hBrush);&#x000A;	for (i = 0; i&lt;4; i++)&#x000A;	{&#x000A;		for (j = 0; j&lt;4; j++)&#x000A;		{&#x000A;			if (bNextCurTeris[i][j])&#x000A;			{&#x000A;				Rectangle(hdc, rc_right_top.left + BLOCK_SIZE*(j + 1), rc_right_top.top + BLOCK_SIZE*(i + 1), rc_right_top.left + BLOCK_SIZE*(j + 2), rc_right_top.top + BLOCK_SIZE*(i + 2));&#x000A;			}&#x000A;		}&#x000A;	}&#x000A;	HFONT hFont = CreateFont(30, 0, 0, 0, FW_THIN, 0, 0, 0, UNICODE, 0, 0, 0, 0, L&quot;微软雅黑&quot;);&#x000A;	SelectObject(hdc, hFont);&#x000A;	SetBkMode(hdc, TRANSPARENT);&#x000A;	SetBkColor(hdc, RGB(255, 255, 0));&#x000A;	RECT rect;&#x000A;	rect.left = rc_right_top.left + 40;&#x000A;	rect.top = rc_right_top.bottom - 150;&#x000A;	rect.right = rc_right_top.right;&#x000A;	rect.bottom = rc_right_top.bottom;&#x000A;	DrawTextW(hdc, TEXT(&quot;下一个&quot;), _tcslen(TEXT(&quot;下一个&quot;)), &amp;rect, 0);&#x000A;	DeleteObject(hFont);&#x000A;	DeleteObject(hBrush);&#x000A;}&#x000A;&#x000A;void drawScore(HDC hdc)&#x000A;{&#x000A;	HFONT hFont = CreateFont(30, 0, 0, 0, FW_THIN, 0, 0, 0, UNICODE, 0, 0, 0, 0, L&quot;微软雅黑&quot;);&#x000A;	SelectObject(hdc, hFont);&#x000A;	SetBkMode(hdc, TRANSPARENT);&#x000A;	SetBkColor(hdc, RGB(255, 255, 0));&#x000A;	RECT rect;&#x000A;	rect.left = rc_right_bottom.left;&#x000A;	rect.top = rc_right_bottom.top;&#x000A;	rect.right = rc_right_bottom.right;&#x000A;	rect.bottom = rc_right_bottom.bottom;&#x000A;	TCHAR szBuf[30];&#x000A;	LPCTSTR cstr = TEXT(&quot;当前难度：%d&quot;);&#x000A;	wsprintf(szBuf, cstr, GAME_DIFF);&#x000A;	DrawTextW(hdc, szBuf, _tcslen(szBuf), &amp;rect, DT_CENTER | DT_VCENTER);&#x000A;&#x000A;	RECT rect2;&#x000A;	rect2.left = rc_right_bottom.left;&#x000A;	rect2.top = rc_right_bottom.bottom / 2 + 100;&#x000A;	rect2.right = rc_right_bottom.right;&#x000A;	rect2.bottom = rc_right_bottom.bottom;&#x000A;	TCHAR szBuf2[30];&#x000A;	LPCTSTR cstr2 = TEXT(&quot;得分：%d&quot;);&#x000A;	wsprintf(szBuf2, cstr2, GAME_SCORE);&#x000A;	//outPutBoxInt(sizeof(szBuf));&#x000A;	DrawTextW(hdc, szBuf2, _tcslen(szBuf2), &amp;rect2, DT_CENTER | DT_VCENTER);&#x000A;&#x000A;	DeleteObject(hFont);&#x000A;}&#x000A;&#x000A;&#x000A;int main()&#x000A;{&#x000A;	return 0;&#x000A;}&#x000A;&#x000A;</textarea>
<a href="#" class="ui button" id="copy-text" style="border-left: none;">一键复制</a>
<a href="/B16041616/B16041616LiHaoMing/edit/master/drawbackground.cpp" class="ui button disabled has_tooltip edit-blob" title="无编辑权限">编辑</a>
<a href="/B16041616/B16041616LiHaoMing/raw/master/drawbackground.cpp" class="ui button edit-raw">原始数据</a>
<a href="/B16041616/B16041616LiHaoMing/blame/master/drawbackground.cpp" class="ui button edit-blame">按行查看</a>
<a href="/B16041616/B16041616LiHaoMing/commits/master/drawbackground.cpp" class="ui button edit-history">历史</a>
</div>
<script>
    if((gon.wait_fork!=undefined && gon.wait_fork==true) || (gon.wait_fetch!=undefined && gon.wait_fetch==true)){
      $('.edit-blob').popup({content:"当前项目正在后台处理中,暂时无法编辑", on: 'hover', delay: { show: 200, hide: 200 }});
      $('.edit-blob').click(function(e){
        e.preventDefault();
      })
    }
  
    setUrl = function(){
      var params = window.location.search
      if (params==undefined || $.trim(params).length==0) return;
      $('span.options').children('.basic').find('a').each(function(index,ele){
        var origin_href = $(ele).attr('href');
        if (origin_href!="#" && origin_href.indexOf('?') == -1){
          $(ele).attr('href',origin_href+params);
        }
      });
    }
  
    setUrl();
  
  
    var $btncopy = $("#copy-text");
    $(document).ready(function() {
      $btncopy.popup({
        content: isCopied ? '已复制':'点击复制'
      })
    })
    var isCopied = false;
    $btncopy.on('click', function() {
      try {
        var clipboard = new Clipboard("#copy-text", {
          text: function(trigger) {
            return $("#blob_raw").val();
          }
        });
        var success = document.execCommand('copy');
        if (success) {
          $btncopy.trigger('copied', ['已复制']);
          isCopied = true;
        } else {
          alert("复制失败，请手动复制")
        }
      } catch (err) {
        $btncopy.trigger('copied', ['点击复制']);
      }
    });
  
    $btncopy.bind('copied', function(event, message) {
      $(this).popup('hide');
      $(this).popup('destroy');
      isCopied = true;
      $(this).popup({content: isCopied ? '已复制':'点击复制'})
      $(this).popup('show');
    });
</script>
</div>
<div class='blob-description'>
<i class='iconfont icon-readme'></i>
<span class='file_name'>
drawbackground.cpp
<small>9.91 KB</small>
</span>
→
<span class='recent-commit' style='margin-top: 0.7rem'>
<a href="/B16041616" class="commit-author-link"><img alt="" avatar="B16041616" class="mini avatar circular ui image " /> <span class="commit-author-name">迷人的李胖子</span></a>
<span>提交于</span>
<span class='timeago commit-date' title='2017-12-27 21:34:48 +0800'>
2017-12-27 21:34
</span>
.
<a href="/B16041616/B16041616LiHaoMing/commit/1026e3fe37d6f91534d18b8b28914c7be353c59c" title="B16041616 李浩铭 drawBackGround和drawTetis">B16041616 李浩铭 drawBackGround和drawTetis</a>
</span>

</div>
</div>
<div class='clearfix'></div>
<div class='file_content code'>
<div class='lines white'>
<div class='line-numbers'><a href='#L1' id='L1' rel='#L#1'>1</a><a href='#L2' id='L2' rel='#L#2'>2</a><a href='#L3' id='L3' rel='#L#3'>3</a><a href='#L4' id='L4' rel='#L#4'>4</a><a href='#L5' id='L5' rel='#L#5'>5</a><a href='#L6' id='L6' rel='#L#6'>6</a><a href='#L7' id='L7' rel='#L#7'>7</a><a href='#L8' id='L8' rel='#L#8'>8</a><a href='#L9' id='L9' rel='#L#9'>9</a><a href='#L10' id='L10' rel='#L#10'>10</a><a href='#L11' id='L11' rel='#L#11'>11</a><a href='#L12' id='L12' rel='#L#12'>12</a><a href='#L13' id='L13' rel='#L#13'>13</a><a href='#L14' id='L14' rel='#L#14'>14</a><a href='#L15' id='L15' rel='#L#15'>15</a><a href='#L16' id='L16' rel='#L#16'>16</a><a href='#L17' id='L17' rel='#L#17'>17</a><a href='#L18' id='L18' rel='#L#18'>18</a><a href='#L19' id='L19' rel='#L#19'>19</a><a href='#L20' id='L20' rel='#L#20'>20</a><a href='#L21' id='L21' rel='#L#21'>21</a><a href='#L22' id='L22' rel='#L#22'>22</a><a href='#L23' id='L23' rel='#L#23'>23</a><a href='#L24' id='L24' rel='#L#24'>24</a><a href='#L25' id='L25' rel='#L#25'>25</a><a href='#L26' id='L26' rel='#L#26'>26</a><a href='#L27' id='L27' rel='#L#27'>27</a><a href='#L28' id='L28' rel='#L#28'>28</a><a href='#L29' id='L29' rel='#L#29'>29</a><a href='#L30' id='L30' rel='#L#30'>30</a><a href='#L31' id='L31' rel='#L#31'>31</a><a href='#L32' id='L32' rel='#L#32'>32</a><a href='#L33' id='L33' rel='#L#33'>33</a><a href='#L34' id='L34' rel='#L#34'>34</a><a href='#L35' id='L35' rel='#L#35'>35</a><a href='#L36' id='L36' rel='#L#36'>36</a><a href='#L37' id='L37' rel='#L#37'>37</a><a href='#L38' id='L38' rel='#L#38'>38</a><a href='#L39' id='L39' rel='#L#39'>39</a><a href='#L40' id='L40' rel='#L#40'>40</a><a href='#L41' id='L41' rel='#L#41'>41</a><a href='#L42' id='L42' rel='#L#42'>42</a><a href='#L43' id='L43' rel='#L#43'>43</a><a href='#L44' id='L44' rel='#L#44'>44</a><a href='#L45' id='L45' rel='#L#45'>45</a><a href='#L46' id='L46' rel='#L#46'>46</a><a href='#L47' id='L47' rel='#L#47'>47</a><a href='#L48' id='L48' rel='#L#48'>48</a><a href='#L49' id='L49' rel='#L#49'>49</a><a href='#L50' id='L50' rel='#L#50'>50</a><a href='#L51' id='L51' rel='#L#51'>51</a><a href='#L52' id='L52' rel='#L#52'>52</a><a href='#L53' id='L53' rel='#L#53'>53</a><a href='#L54' id='L54' rel='#L#54'>54</a><a href='#L55' id='L55' rel='#L#55'>55</a><a href='#L56' id='L56' rel='#L#56'>56</a><a href='#L57' id='L57' rel='#L#57'>57</a><a href='#L58' id='L58' rel='#L#58'>58</a><a href='#L59' id='L59' rel='#L#59'>59</a><a href='#L60' id='L60' rel='#L#60'>60</a><a href='#L61' id='L61' rel='#L#61'>61</a><a href='#L62' id='L62' rel='#L#62'>62</a><a href='#L63' id='L63' rel='#L#63'>63</a><a href='#L64' id='L64' rel='#L#64'>64</a><a href='#L65' id='L65' rel='#L#65'>65</a><a href='#L66' id='L66' rel='#L#66'>66</a><a href='#L67' id='L67' rel='#L#67'>67</a><a href='#L68' id='L68' rel='#L#68'>68</a><a href='#L69' id='L69' rel='#L#69'>69</a><a href='#L70' id='L70' rel='#L#70'>70</a><a href='#L71' id='L71' rel='#L#71'>71</a><a href='#L72' id='L72' rel='#L#72'>72</a><a href='#L73' id='L73' rel='#L#73'>73</a><a href='#L74' id='L74' rel='#L#74'>74</a><a href='#L75' id='L75' rel='#L#75'>75</a><a href='#L76' id='L76' rel='#L#76'>76</a><a href='#L77' id='L77' rel='#L#77'>77</a><a href='#L78' id='L78' rel='#L#78'>78</a><a href='#L79' id='L79' rel='#L#79'>79</a><a href='#L80' id='L80' rel='#L#80'>80</a><a href='#L81' id='L81' rel='#L#81'>81</a><a href='#L82' id='L82' rel='#L#82'>82</a><a href='#L83' id='L83' rel='#L#83'>83</a><a href='#L84' id='L84' rel='#L#84'>84</a><a href='#L85' id='L85' rel='#L#85'>85</a><a href='#L86' id='L86' rel='#L#86'>86</a><a href='#L87' id='L87' rel='#L#87'>87</a><a href='#L88' id='L88' rel='#L#88'>88</a><a href='#L89' id='L89' rel='#L#89'>89</a><a href='#L90' id='L90' rel='#L#90'>90</a><a href='#L91' id='L91' rel='#L#91'>91</a><a href='#L92' id='L92' rel='#L#92'>92</a><a href='#L93' id='L93' rel='#L#93'>93</a><a href='#L94' id='L94' rel='#L#94'>94</a><a href='#L95' id='L95' rel='#L#95'>95</a><a href='#L96' id='L96' rel='#L#96'>96</a><a href='#L97' id='L97' rel='#L#97'>97</a><a href='#L98' id='L98' rel='#L#98'>98</a><a href='#L99' id='L99' rel='#L#99'>99</a><a href='#L100' id='L100' rel='#L#100'>100</a><a href='#L101' id='L101' rel='#L#101'>101</a><a href='#L102' id='L102' rel='#L#102'>102</a><a href='#L103' id='L103' rel='#L#103'>103</a><a href='#L104' id='L104' rel='#L#104'>104</a><a href='#L105' id='L105' rel='#L#105'>105</a><a href='#L106' id='L106' rel='#L#106'>106</a><a href='#L107' id='L107' rel='#L#107'>107</a><a href='#L108' id='L108' rel='#L#108'>108</a><a href='#L109' id='L109' rel='#L#109'>109</a><a href='#L110' id='L110' rel='#L#110'>110</a><a href='#L111' id='L111' rel='#L#111'>111</a><a href='#L112' id='L112' rel='#L#112'>112</a><a href='#L113' id='L113' rel='#L#113'>113</a><a href='#L114' id='L114' rel='#L#114'>114</a><a href='#L115' id='L115' rel='#L#115'>115</a><a href='#L116' id='L116' rel='#L#116'>116</a><a href='#L117' id='L117' rel='#L#117'>117</a><a href='#L118' id='L118' rel='#L#118'>118</a><a href='#L119' id='L119' rel='#L#119'>119</a><a href='#L120' id='L120' rel='#L#120'>120</a><a href='#L121' id='L121' rel='#L#121'>121</a><a href='#L122' id='L122' rel='#L#122'>122</a><a href='#L123' id='L123' rel='#L#123'>123</a><a href='#L124' id='L124' rel='#L#124'>124</a><a href='#L125' id='L125' rel='#L#125'>125</a><a href='#L126' id='L126' rel='#L#126'>126</a><a href='#L127' id='L127' rel='#L#127'>127</a><a href='#L128' id='L128' rel='#L#128'>128</a><a href='#L129' id='L129' rel='#L#129'>129</a><a href='#L130' id='L130' rel='#L#130'>130</a><a href='#L131' id='L131' rel='#L#131'>131</a><a href='#L132' id='L132' rel='#L#132'>132</a><a href='#L133' id='L133' rel='#L#133'>133</a><a href='#L134' id='L134' rel='#L#134'>134</a><a href='#L135' id='L135' rel='#L#135'>135</a><a href='#L136' id='L136' rel='#L#136'>136</a><a href='#L137' id='L137' rel='#L#137'>137</a><a href='#L138' id='L138' rel='#L#138'>138</a><a href='#L139' id='L139' rel='#L#139'>139</a><a href='#L140' id='L140' rel='#L#140'>140</a><a href='#L141' id='L141' rel='#L#141'>141</a><a href='#L142' id='L142' rel='#L#142'>142</a><a href='#L143' id='L143' rel='#L#143'>143</a><a href='#L144' id='L144' rel='#L#144'>144</a><a href='#L145' id='L145' rel='#L#145'>145</a><a href='#L146' id='L146' rel='#L#146'>146</a><a href='#L147' id='L147' rel='#L#147'>147</a><a href='#L148' id='L148' rel='#L#148'>148</a><a href='#L149' id='L149' rel='#L#149'>149</a><a href='#L150' id='L150' rel='#L#150'>150</a><a href='#L151' id='L151' rel='#L#151'>151</a><a href='#L152' id='L152' rel='#L#152'>152</a><a href='#L153' id='L153' rel='#L#153'>153</a><a href='#L154' id='L154' rel='#L#154'>154</a><a href='#L155' id='L155' rel='#L#155'>155</a><a href='#L156' id='L156' rel='#L#156'>156</a><a href='#L157' id='L157' rel='#L#157'>157</a><a href='#L158' id='L158' rel='#L#158'>158</a><a href='#L159' id='L159' rel='#L#159'>159</a><a href='#L160' id='L160' rel='#L#160'>160</a><a href='#L161' id='L161' rel='#L#161'>161</a><a href='#L162' id='L162' rel='#L#162'>162</a><a href='#L163' id='L163' rel='#L#163'>163</a><a href='#L164' id='L164' rel='#L#164'>164</a><a href='#L165' id='L165' rel='#L#165'>165</a><a href='#L166' id='L166' rel='#L#166'>166</a><a href='#L167' id='L167' rel='#L#167'>167</a><a href='#L168' id='L168' rel='#L#168'>168</a><a href='#L169' id='L169' rel='#L#169'>169</a><a href='#L170' id='L170' rel='#L#170'>170</a><a href='#L171' id='L171' rel='#L#171'>171</a><a href='#L172' id='L172' rel='#L#172'>172</a><a href='#L173' id='L173' rel='#L#173'>173</a><a href='#L174' id='L174' rel='#L#174'>174</a><a href='#L175' id='L175' rel='#L#175'>175</a><a href='#L176' id='L176' rel='#L#176'>176</a><a href='#L177' id='L177' rel='#L#177'>177</a><a href='#L178' id='L178' rel='#L#178'>178</a><a href='#L179' id='L179' rel='#L#179'>179</a><a href='#L180' id='L180' rel='#L#180'>180</a><a href='#L181' id='L181' rel='#L#181'>181</a></div><div class='highlight'><pre><div class='line' id='LC1'><span class="err">﻿</span><span class="c1">// drawbackground.cpp: 定义控制台应用程序的入口点。
</div><div class='line' id='LC2'>//
</div><div class='line' id='LC3'></span>
</div><div class='line' id='LC4'><span class="c1">// draw.cpp: 定义控制台应用程序的入口点。</span>
</div><div class='line' id='LC5'><span class='c1'>//</span>
</div><div class='line' id='LC6'><span class='c1'></span></span>
</div><div class='line' id='LC7'><span class='c1'><span class="cp">#include "stdafx.h"</span>
</div><div class='line' id='LC8'><span class='c1'>#include&lt;Windows.h&gt;</span>
</div><div class='line' id='LC9'><span class='c1'></span></span>
</div><div class='line' id='LC10'><span class='c1'><span class="kt">bool</span> <span class="n">g_hasBlocked</span><span class="p">[</span><span class="mi">50</span><span class="p">][</span><span class="mi">50</span><span class="p">];</span>
</div><div class='line' id='LC11'><span class="n">BOOL</span> <span class="n">bCurTeris</span><span class="p">[</span><span class="mi">4</span><span class="p">][</span><span class="mi">4</span><span class="p">];</span>
</div><div class='line' id='LC12'><span class="n">BOOL</span> <span class="n">bNextCurTeris</span><span class="p">[</span><span class="mi">4</span><span class="p">][</span><span class="mi">4</span><span class="p">];</span>
</div><div class='line' id='LC13'><span class="n">RECT</span> <span class="n">rc_left</span><span class="p">,</span> <span class="n">rc_right</span><span class="p">,</span> <span class="n">rc_right_top</span><span class="p">,</span> <span class="n">rc_right_bottom</span><span class="p">,</span> <span class="n">rc_main</span><span class="p">;</span>
</div><div class='line' id='LC14'><span class="kt">int</span> <span class="n">NUM_X</span> <span class="o">=</span> <span class="mi">10</span><span class="p">;</span>
</div><div class='line' id='LC15'><span class="kt">int</span> <span class="n">NUM_Y</span> <span class="o">=</span> <span class="mi">20</span><span class="p">;</span>
</div><div class='line' id='LC16'><span class="kt">int</span> <span class="n">curPosX</span><span class="p">,</span> <span class="n">curPosY</span><span class="p">;</span>
</div><div class='line' id='LC17'><span class="kt">int</span> <span class="n">BLOCK_SIZE</span> <span class="o">=</span> <span class="mi">30</span><span class="p">;</span>
</div><div class='line' id='LC18'><span class="kt">int</span> <span class="n">GAME_DIFF</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
</div><div class='line' id='LC19'><span class="kt">int</span> <span class="n">GAME_SCORE</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
</div><div class='line' id='LC20'><span class="k">const</span> <span class="kt">int</span> <span class="n">BORDER_X</span> <span class="o">=</span> <span class="mi">10</span><span class="p">;</span>
</div><div class='line' id='LC21'><span class="k">const</span> <span class="kt">int</span> <span class="n">BORDER_Y</span> <span class="o">=</span> <span class="mi">10</span><span class="p">;</span>
</div><div class='line' id='LC22'><span class="k">const</span> <span class="kt">int</span> <span class="n">SCREEN_LEFT_X</span> <span class="o">=</span> <span class="mi">300</span> <span class="o">+</span> <span class="n">BORDER_X</span><span class="p">;</span>
</div><div class='line' id='LC23'><span class="k">const</span> <span class="kt">int</span> <span class="n">SCREEN_Y</span> <span class="o">=</span> <span class="mi">600</span> <span class="o">+</span> <span class="n">BORDER_Y</span><span class="p">;</span>
</div><div class='line' id='LC24'><span class="k">const</span> <span class="kt">int</span> <span class="n">SCREEN_RIGHT_X</span> <span class="o">=</span> <span class="mi">180</span> <span class="o">+</span> <span class="n">BORDER_X</span> <span class="o">*</span> <span class="mi">2</span><span class="p">;</span>
</div><div class='line' id='LC25'><span class="k">const</span> <span class="kt">int</span> <span class="n">SCREEN_X</span> <span class="o">=</span> <span class="n">SCREEN_LEFT_X</span> <span class="o">+</span> <span class="n">SCREEN_RIGHT_X</span><span class="p">;</span>
</div><div class='line' id='LC26'>
</div><div class='line' id='LC27'><span class="kt">void</span> <span class="n">drawNext</span><span class="p">(</span><span class="n">HDC</span> <span class="n">hdc</span><span class="p">);</span>
</div><div class='line' id='LC28'><span class="kt">void</span> <span class="n">drawScore</span><span class="p">(</span><span class="n">HDC</span> <span class="n">hdc</span><span class="p">);</span>
</div><div class='line' id='LC29'>
</div><div class='line' id='LC30'>
</div><div class='line' id='LC31'><span class="kt">void</span> <span class="nf">drawBlocked</span><span class="p">(</span><span class="n">HDC</span> <span class="n">mdc</span><span class="p">)</span><span class="c1">//绘制当前已经存在砖块的区域
</div><div class='line' id='LC32'></span><span class="p">{</span>
</div><div class='line' id='LC33'>	<span class="kt">int</span> <span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">;</span>
</div><div class='line' id='LC34'>	<span class="c1">//在应用程序调用CreateSolidBrush创建刷子以后，可以通过调用SelectObject函数把该刷子选入设备环境</span>
</div><div class='line' id='LC35'><span class='c1'></span>	<span class="n">HBRUSH</span> <span class="n">hBrush</span> <span class="o">=</span> <span class="p">(</span><span class="n">HBRUSH</span><span class="p">)</span><span class="n">CreateSolidBrush</span><span class="p">(</span><span class="n">RGB</span><span class="p">(</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">0</span><span class="p">));</span><span class="c1">//画刷句柄，黄色</span>
</div><div class='line' id='LC36'><span class='c1'></span></span>
</div><div class='line' id='LC37'><span class='c1'>	<span class="n">SelectObject</span><span class="p">(</span><span class="n">mdc</span><span class="p">,</span> <span class="n">hBrush</span><span class="p">);</span><span class="c1">//函数选择一对象到指定的设备上下文环境中，新对象替换先前的相同类型的对象
</div><div class='line' id='LC38'></span>
</div><div class='line' id='LC39'>	<span class="k">for</span> <span class="p">(</span><span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">i</span><span class="o">&lt;</span><span class="n">NUM_Y</span><span class="p">;</span> <span class="n">i</span><span class="o">++</span><span class="p">)</span>
</div><div class='line' id='LC40'>	<span class="p">{</span>
</div><div class='line' id='LC41'>		<span class="k">for</span> <span class="p">(</span><span class="n">j</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">j</span><span class="o">&lt;</span><span class="n">NUM_X</span><span class="p">;</span> <span class="n">j</span><span class="o">++</span><span class="p">)</span>
</div><div class='line' id='LC42'>		<span class="p">{</span>
</div><div class='line' id='LC43'>			<span class="k">if</span> <span class="p">(</span><span class="n">g_hasBlocked</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">])</span>
</div><div class='line' id='LC44'>			<span class="p">{</span>
</div><div class='line' id='LC45'>				<span class="n">Rectangle</span><span class="p">(</span><span class="n">mdc</span><span class="p">,</span> <span class="n">BORDER_X</span> <span class="o">+</span> <span class="n">j</span><span class="o">*</span><span class="n">BLOCK_SIZE</span><span class="p">,</span> <span class="n">BORDER_Y</span> <span class="o">+</span> <span class="n">i</span><span class="o">*</span><span class="n">BLOCK_SIZE</span><span class="p">,</span>
</div><div class='line' id='LC46'>					<span class="n">BORDER_X</span> <span class="o">+</span> <span class="p">(</span><span class="n">j</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span><span class="o">*</span><span class="n">BLOCK_SIZE</span><span class="p">,</span> <span class="n">BORDER_Y</span> <span class="o">+</span> <span class="p">(</span><span class="n">i</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span><span class="o">*</span><span class="n">BLOCK_SIZE</span>
</div><div class='line' id='LC47'>				<span class="p">);</span><span class="c1">//绘画矩形的函数，并用当前颜色的画刷进行颜色的填充
</div><div class='line' id='LC48'></span>			<span class="p">}</span>
</div><div class='line' id='LC49'>		<span class="p">}</span>
</div><div class='line' id='LC50'>	<span class="p">}</span>
</div><div class='line' id='LC51'>	<span class="n">DeleteObject</span><span class="p">(</span><span class="n">hBrush</span><span class="p">);</span><span class="c1">//该函数删除一个逻辑笔、画笔、字体、 位图、区域或者调色板，释放所有与该对象有关的系统资源
</div><div class='line' id='LC52'></span><span class="p">}</span>
</div><div class='line' id='LC53'><span class="n">VOID</span> <span class="nf">DrawTeris</span><span class="p">(</span><span class="n">HDC</span> <span class="n">mdc</span><span class="p">)</span>
</div><div class='line' id='LC54'><span class="p">{</span>
</div><div class='line' id='LC55'>
</div><div class='line' id='LC56'>	<span class="kt">int</span> <span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">;</span>
</div><div class='line' id='LC57'>	<span class="n">HPEN</span> <span class="n">hPen</span> <span class="o">=</span> <span class="p">(</span><span class="n">HPEN</span><span class="p">)</span><span class="n">GetStockObject</span><span class="p">(</span><span class="n">BLACK_PEN</span><span class="p">);</span><span class="c1">//画笔句柄
</div><div class='line' id='LC58'></span>	<span class="n">HBRUSH</span> <span class="n">hBrush</span> <span class="o">=</span> <span class="p">(</span><span class="n">HBRUSH</span><span class="p">)</span><span class="n">GetStockObject</span><span class="p">(</span><span class="n">WHITE_BRUSH</span><span class="p">);</span>
</div><div class='line' id='LC59'>	<span class="n">SelectObject</span><span class="p">(</span><span class="n">mdc</span><span class="p">,</span> <span class="n">hPen</span><span class="p">);</span><span class="c1">//electObject是计算机编程语言函数，该函数选择一对象到指定的设备上下文环境中，新对象替换先前的相同类型的对象
</div><div class='line' id='LC60'></span>	<span class="n">SelectObject</span><span class="p">(</span><span class="n">mdc</span><span class="p">,</span> <span class="n">hBrush</span><span class="p">);</span>
</div><div class='line' id='LC61'>	<span class="k">for</span> <span class="p">(</span><span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">i</span><span class="o">&lt;</span><span class="mi">4</span><span class="p">;</span> <span class="n">i</span><span class="o">++</span><span class="p">)</span>
</div><div class='line' id='LC62'>	<span class="p">{</span>
</div><div class='line' id='LC63'>		<span class="k">for</span> <span class="p">(</span><span class="n">j</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">j</span><span class="o">&lt;</span><span class="mi">4</span><span class="p">;</span> <span class="n">j</span><span class="o">++</span><span class="p">)</span>
</div><div class='line' id='LC64'>		<span class="p">{</span>
</div><div class='line' id='LC65'>			<span class="k">if</span> <span class="p">(</span><span class="n">bCurTeris</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">])</span>
</div><div class='line' id='LC66'>			<span class="p">{</span>
</div><div class='line' id='LC67'>				<span class="n">Rectangle</span><span class="p">(</span><span class="n">mdc</span><span class="p">,</span> <span class="p">(</span><span class="n">j</span> <span class="o">+</span> <span class="n">curPosX</span><span class="p">)</span><span class="o">*</span><span class="n">BLOCK_SIZE</span> <span class="o">+</span> <span class="n">BORDER_X</span><span class="p">,</span> <span class="p">(</span><span class="n">i</span> <span class="o">+</span> <span class="n">curPosY</span><span class="p">)</span><span class="o">*</span><span class="n">BLOCK_SIZE</span> <span class="o">+</span> <span class="n">BORDER_Y</span><span class="p">,</span> <span class="p">(</span><span class="n">j</span> <span class="o">+</span> <span class="mi">1</span> <span class="o">+</span> <span class="n">curPosX</span><span class="p">)</span><span class="o">*</span><span class="n">BLOCK_SIZE</span> <span class="o">+</span> <span class="n">BORDER_X</span><span class="p">,</span> <span class="p">(</span><span class="n">i</span> <span class="o">+</span> <span class="mi">1</span> <span class="o">+</span> <span class="n">curPosY</span><span class="p">)</span><span class="o">*</span><span class="n">BLOCK_SIZE</span> <span class="o">+</span> <span class="n">BORDER_Y</span><span class="p">);</span>
</div><div class='line' id='LC68'>			<span class="p">}</span>
</div><div class='line' id='LC69'>		<span class="p">}</span>
</div><div class='line' id='LC70'>	<span class="p">}</span>
</div><div class='line' id='LC71'>	<span class="n">drawBlocked</span><span class="p">(</span><span class="n">mdc</span><span class="p">);</span>
</div><div class='line' id='LC72'>	<span class="n">DeleteObject</span><span class="p">(</span><span class="n">hPen</span><span class="p">);</span>
</div><div class='line' id='LC73'>	<span class="n">DeleteObject</span><span class="p">(</span><span class="n">hBrush</span><span class="p">);</span>
</div><div class='line' id='LC74'><span class="p">}</span>
</div><div class='line' id='LC75'>
</div><div class='line' id='LC76'><span class="n">VOID</span> <span class="nf">DrawBackGround</span><span class="p">(</span><span class="n">HDC</span> <span class="n">hdc</span><span class="p">)</span><span class="c1">//绘制背景
</div><div class='line' id='LC77'></span><span class="p">{</span>
</div><div class='line' id='LC78'>
</div><div class='line' id='LC79'>	<span class="n">HBRUSH</span> <span class="n">hBrush</span> <span class="o">=</span> <span class="p">(</span><span class="n">HBRUSH</span><span class="p">)</span><span class="n">GetStockObject</span><span class="p">(</span><span class="n">GRAY_BRUSH</span><span class="p">);</span>
</div><div class='line' id='LC80'>	<span class="c1">//适用于支持光栅操作的设备，应用程序可以通过调用GetDeviceCaps函数来确定一个设备是否支持这些操作</span>
</div><div class='line' id='LC81'><span class='c1'></span>	<span class="n">HDC</span> <span class="n">mdc</span> <span class="o">=</span> <span class="n">CreateCompatibleDC</span><span class="p">(</span><span class="n">hdc</span><span class="p">);</span></span>
</div><div class='line' id='LC82'><span class='c1'>	<span class="n">HBITMAP</span> <span class="n">hBitmap</span> <span class="o">=</span> <span class="n">CreateCompatibleBitmap</span><span class="p">(</span><span class="n">hdc</span><span class="p">,</span> <span class="n">SCREEN_X</span><span class="p">,</span> <span class="n">SCREEN_Y</span><span class="p">);</span>
</div><div class='line' id='LC83'>
</div><div class='line' id='LC84'>	<span class="n">SelectObject</span><span class="p">(</span><span class="n">mdc</span><span class="p">,</span> <span class="n">hBrush</span><span class="p">);</span>
</div><div class='line' id='LC85'>	<span class="n">SelectObject</span><span class="p">(</span><span class="n">mdc</span><span class="p">,</span> <span class="n">hBitmap</span><span class="p">);</span>
</div><div class='line' id='LC86'>
</div><div class='line' id='LC87'>	<span class="n">HBRUSH</span> <span class="n">hBrush2</span> <span class="o">=</span> <span class="p">(</span><span class="n">HBRUSH</span><span class="p">)</span><span class="n">GetStockObject</span><span class="p">(</span><span class="n">WHITE_BRUSH</span><span class="p">);</span>
</div><div class='line' id='LC88'>	<span class="n">FillRect</span><span class="p">(</span><span class="n">mdc</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">rc_main</span><span class="p">,</span> <span class="n">hBrush2</span><span class="p">);</span>
</div><div class='line' id='LC89'>	<span class="n">Rectangle</span><span class="p">(</span><span class="n">mdc</span><span class="p">,</span> <span class="n">rc_left</span><span class="p">.</span><span class="n">left</span> <span class="o">+</span> <span class="n">BORDER_X</span><span class="p">,</span> <span class="n">rc_left</span><span class="p">.</span><span class="n">top</span> <span class="o">+</span> <span class="n">BORDER_Y</span><span class="p">,</span> <span class="n">rc_left</span><span class="p">.</span><span class="n">right</span><span class="p">,</span> <span class="n">rc_left</span><span class="p">.</span><span class="n">bottom</span><span class="p">);</span>
</div><div class='line' id='LC90'>	<span class="n">Rectangle</span><span class="p">(</span><span class="n">mdc</span><span class="p">,</span> <span class="n">rc_right</span><span class="p">.</span><span class="n">left</span> <span class="o">+</span> <span class="n">BORDER_X</span><span class="p">,</span> <span class="n">rc_right</span><span class="p">.</span><span class="n">top</span> <span class="o">+</span> <span class="n">BORDER_Y</span><span class="p">,</span> <span class="n">rc_right</span><span class="p">.</span><span class="n">right</span><span class="p">,</span> <span class="n">rc_right</span><span class="p">.</span><span class="n">bottom</span><span class="p">);</span>
</div><div class='line' id='LC91'>	<span class="n">DrawTeris</span><span class="p">(</span><span class="n">mdc</span><span class="p">);</span>
</div><div class='line' id='LC92'>	<span class="n">drawNext</span><span class="p">(</span><span class="n">mdc</span><span class="p">);</span>
</div><div class='line' id='LC93'>	<span class="n">drawScore</span><span class="p">(</span><span class="n">mdc</span><span class="p">);</span>
</div><div class='line' id='LC94'>	<span class="o">::</span><span class="n">BitBlt</span><span class="p">(</span><span class="n">hdc</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">SCREEN_X</span><span class="p">,</span> <span class="n">SCREEN_Y</span><span class="p">,</span> <span class="n">mdc</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">SRCCOPY</span><span class="p">);</span>
</div><div class='line' id='LC95'>	<span class="n">DeleteObject</span><span class="p">(</span><span class="n">hBrush</span><span class="p">);</span>
</div><div class='line' id='LC96'>	<span class="n">DeleteDC</span><span class="p">(</span><span class="n">mdc</span><span class="p">);</span>
</div><div class='line' id='LC97'>	<span class="n">DeleteObject</span><span class="p">(</span><span class="n">hBitmap</span><span class="p">);</span>
</div><div class='line' id='LC98'>	<span class="n">DeleteObject</span><span class="p">(</span><span class="n">hBrush2</span><span class="p">);</span>
</div><div class='line' id='LC99'>
</div><div class='line' id='LC100'>
</div><div class='line' id='LC101'>	<span class="c1">//  int x,y;</span>
</div><div class='line' id='LC102'><span class='c1'></span>	<span class="c1">//  HPEN hPen = (HPEN)GetStockObject(NULL_PEN);</span>
</div><div class='line' id='LC103'><span class='c1'></span>	<span class="c1">//  HBRUSH hBrush = (HBRUSH)GetStockObject(GRAY_BRUSH);</span>
</div><div class='line' id='LC104'><span class='c1'></span>	<span class="c1">//  SelectObject(hdc,hPen);</span>
</div><div class='line' id='LC105'><span class='c1'></span>	<span class="c1">//  SelectObject(hdc,hBrush);</span>
</div><div class='line' id='LC106'><span class='c1'></span>	<span class="c1">//  for (x = 0;x&lt;NUM_X;x++)</span>
</div><div class='line' id='LC107'><span class='c1'></span>	<span class="c1">//  {</span>
</div><div class='line' id='LC108'><span class='c1'></span>	<span class="c1">//      for(y=0;y&lt;NUM_Y;y++)</span>
</div><div class='line' id='LC109'><span class='c1'></span>	<span class="c1">//      {</span>
</div><div class='line' id='LC110'><span class='c1'></span>	<span class="c1">//          Rectangle(hdc,BORDER_X+x*BLOCK_SIZE,BORDER_Y+y*BLOCK_SIZE,</span>
</div><div class='line' id='LC111'><span class='c1'></span>	<span class="c1">//              BORDER_X+(x+1)*BLOCK_SIZE,</span>
</div><div class='line' id='LC112'><span class='c1'></span>	<span class="c1">//              BORDER_Y+(y+1)*BLOCK_SIZE);</span>
</div><div class='line' id='LC113'><span class='c1'></span>	<span class="c1">//      }</span>
</div><div class='line' id='LC114'><span class='c1'></span>	<span class="c1">//  }</span>
</div><div class='line' id='LC115'><span class='c1'></span><span class="p">}</span></span>
</div><div class='line' id='LC116'><span class='c1'></span>
</div><div class='line' id='LC117'><span class='c1'><span class="kt">void</span> <span class="nf">drawNext</span><span class="p">(</span><span class="n">HDC</span> <span class="n">hdc</span><span class="p">)</span><span class="c1">//绘制下一个将要掉落的方块
</div><div class='line' id='LC118'></span><span class="p">{</span>
</div><div class='line' id='LC119'>	<span class="kt">int</span> <span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">;</span>
</div><div class='line' id='LC120'>	<span class="n">HBRUSH</span> <span class="n">hBrush</span> <span class="o">=</span> <span class="p">(</span><span class="n">HBRUSH</span><span class="p">)</span><span class="n">CreateSolidBrush</span><span class="p">(</span><span class="n">RGB</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">188</span><span class="p">,</span> <span class="mi">0</span><span class="p">));</span>
</div><div class='line' id='LC121'>	<span class="n">SelectObject</span><span class="p">(</span><span class="n">hdc</span><span class="p">,</span> <span class="n">hBrush</span><span class="p">);</span>
</div><div class='line' id='LC122'>	<span class="k">for</span> <span class="p">(</span><span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">i</span><span class="o">&lt;</span><span class="mi">4</span><span class="p">;</span> <span class="n">i</span><span class="o">++</span><span class="p">)</span>
</div><div class='line' id='LC123'>	<span class="p">{</span>
</div><div class='line' id='LC124'>		<span class="k">for</span> <span class="p">(</span><span class="n">j</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">j</span><span class="o">&lt;</span><span class="mi">4</span><span class="p">;</span> <span class="n">j</span><span class="o">++</span><span class="p">)</span>
</div><div class='line' id='LC125'>		<span class="p">{</span>
</div><div class='line' id='LC126'>			<span class="k">if</span> <span class="p">(</span><span class="n">bNextCurTeris</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">])</span>
</div><div class='line' id='LC127'>			<span class="p">{</span>
</div><div class='line' id='LC128'>				<span class="n">Rectangle</span><span class="p">(</span><span class="n">hdc</span><span class="p">,</span> <span class="n">rc_right_top</span><span class="p">.</span><span class="n">left</span> <span class="o">+</span> <span class="n">BLOCK_SIZE</span><span class="o">*</span><span class="p">(</span><span class="n">j</span> <span class="o">+</span> <span class="mi">1</span><span class="p">),</span> <span class="n">rc_right_top</span><span class="p">.</span><span class="n">top</span> <span class="o">+</span> <span class="n">BLOCK_SIZE</span><span class="o">*</span><span class="p">(</span><span class="n">i</span> <span class="o">+</span> <span class="mi">1</span><span class="p">),</span> <span class="n">rc_right_top</span><span class="p">.</span><span class="n">left</span> <span class="o">+</span> <span class="n">BLOCK_SIZE</span><span class="o">*</span><span class="p">(</span><span class="n">j</span> <span class="o">+</span> <span class="mi">2</span><span class="p">),</span> <span class="n">rc_right_top</span><span class="p">.</span><span class="n">top</span> <span class="o">+</span> <span class="n">BLOCK_SIZE</span><span class="o">*</span><span class="p">(</span><span class="n">i</span> <span class="o">+</span> <span class="mi">2</span><span class="p">));</span>
</div><div class='line' id='LC129'>			<span class="p">}</span>
</div><div class='line' id='LC130'>		<span class="p">}</span>
</div><div class='line' id='LC131'>	<span class="p">}</span>
</div><div class='line' id='LC132'>	<span class="n">HFONT</span> <span class="n">hFont</span> <span class="o">=</span> <span class="n">CreateFont</span><span class="p">(</span><span class="mi">30</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">FW_THIN</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">UNICODE</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="s">L"微软雅黑"</span><span class="p">);</span>
</div><div class='line' id='LC133'>	<span class="n">SelectObject</span><span class="p">(</span><span class="n">hdc</span><span class="p">,</span> <span class="n">hFont</span><span class="p">);</span>
</div><div class='line' id='LC134'>	<span class="n">SetBkMode</span><span class="p">(</span><span class="n">hdc</span><span class="p">,</span> <span class="n">TRANSPARENT</span><span class="p">);</span>
</div><div class='line' id='LC135'>	<span class="n">SetBkColor</span><span class="p">(</span><span class="n">hdc</span><span class="p">,</span> <span class="n">RGB</span><span class="p">(</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">0</span><span class="p">));</span>
</div><div class='line' id='LC136'>	<span class="n">RECT</span> <span class="n">rect</span><span class="p">;</span>
</div><div class='line' id='LC137'>	<span class="n">rect</span><span class="p">.</span><span class="n">left</span> <span class="o">=</span> <span class="n">rc_right_top</span><span class="p">.</span><span class="n">left</span> <span class="o">+</span> <span class="mi">40</span><span class="p">;</span>
</div><div class='line' id='LC138'>	<span class="n">rect</span><span class="p">.</span><span class="n">top</span> <span class="o">=</span> <span class="n">rc_right_top</span><span class="p">.</span><span class="n">bottom</span> <span class="o">-</span> <span class="mi">150</span><span class="p">;</span>
</div><div class='line' id='LC139'>	<span class="n">rect</span><span class="p">.</span><span class="n">right</span> <span class="o">=</span> <span class="n">rc_right_top</span><span class="p">.</span><span class="n">right</span><span class="p">;</span>
</div><div class='line' id='LC140'>	<span class="n">rect</span><span class="p">.</span><span class="n">bottom</span> <span class="o">=</span> <span class="n">rc_right_top</span><span class="p">.</span><span class="n">bottom</span><span class="p">;</span>
</div><div class='line' id='LC141'>	<span class="n">DrawTextW</span><span class="p">(</span><span class="n">hdc</span><span class="p">,</span> <span class="n">TEXT</span><span class="p">(</span><span class="s">"下一个"</span><span class="p">),</span> <span class="n">_tcslen</span><span class="p">(</span><span class="n">TEXT</span><span class="p">(</span><span class="s">"下一个"</span><span class="p">)),</span> <span class="o">&amp;</span><span class="n">rect</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
</div><div class='line' id='LC142'>	<span class="n">DeleteObject</span><span class="p">(</span><span class="n">hFont</span><span class="p">);</span>
</div><div class='line' id='LC143'>	<span class="n">DeleteObject</span><span class="p">(</span><span class="n">hBrush</span><span class="p">);</span>
</div><div class='line' id='LC144'><span class="p">}</span>
</div><div class='line' id='LC145'>
</div><div class='line' id='LC146'><span class="kt">void</span> <span class="nf">drawScore</span><span class="p">(</span><span class="n">HDC</span> <span class="n">hdc</span><span class="p">)</span>
</div><div class='line' id='LC147'><span class="p">{</span>
</div><div class='line' id='LC148'>	<span class="n">HFONT</span> <span class="n">hFont</span> <span class="o">=</span> <span class="n">CreateFont</span><span class="p">(</span><span class="mi">30</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">FW_THIN</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">UNICODE</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="s">L"微软雅黑"</span><span class="p">);</span>
</div><div class='line' id='LC149'>	<span class="n">SelectObject</span><span class="p">(</span><span class="n">hdc</span><span class="p">,</span> <span class="n">hFont</span><span class="p">);</span>
</div><div class='line' id='LC150'>	<span class="n">SetBkMode</span><span class="p">(</span><span class="n">hdc</span><span class="p">,</span> <span class="n">TRANSPARENT</span><span class="p">);</span>
</div><div class='line' id='LC151'>	<span class="n">SetBkColor</span><span class="p">(</span><span class="n">hdc</span><span class="p">,</span> <span class="n">RGB</span><span class="p">(</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">0</span><span class="p">));</span>
</div><div class='line' id='LC152'>	<span class="n">RECT</span> <span class="n">rect</span><span class="p">;</span>
</div><div class='line' id='LC153'>	<span class="n">rect</span><span class="p">.</span><span class="n">left</span> <span class="o">=</span> <span class="n">rc_right_bottom</span><span class="p">.</span><span class="n">left</span><span class="p">;</span>
</div><div class='line' id='LC154'>	<span class="n">rect</span><span class="p">.</span><span class="n">top</span> <span class="o">=</span> <span class="n">rc_right_bottom</span><span class="p">.</span><span class="n">top</span><span class="p">;</span>
</div><div class='line' id='LC155'>	<span class="n">rect</span><span class="p">.</span><span class="n">right</span> <span class="o">=</span> <span class="n">rc_right_bottom</span><span class="p">.</span><span class="n">right</span><span class="p">;</span>
</div><div class='line' id='LC156'>	<span class="n">rect</span><span class="p">.</span><span class="n">bottom</span> <span class="o">=</span> <span class="n">rc_right_bottom</span><span class="p">.</span><span class="n">bottom</span><span class="p">;</span>
</div><div class='line' id='LC157'>	<span class="n">TCHAR</span> <span class="n">szBuf</span><span class="p">[</span><span class="mi">30</span><span class="p">];</span>
</div><div class='line' id='LC158'>	<span class="n">LPCTSTR</span> <span class="n">cstr</span> <span class="o">=</span> <span class="n">TEXT</span><span class="p">(</span><span class="s">"当前难度：%d"</span><span class="p">);</span>
</div><div class='line' id='LC159'>	<span class="n">wsprintf</span><span class="p">(</span><span class="n">szBuf</span><span class="p">,</span> <span class="n">cstr</span><span class="p">,</span> <span class="n">GAME_DIFF</span><span class="p">);</span>
</div><div class='line' id='LC160'>	<span class="n">DrawTextW</span><span class="p">(</span><span class="n">hdc</span><span class="p">,</span> <span class="n">szBuf</span><span class="p">,</span> <span class="n">_tcslen</span><span class="p">(</span><span class="n">szBuf</span><span class="p">),</span> <span class="o">&amp;</span><span class="n">rect</span><span class="p">,</span> <span class="n">DT_CENTER</span> <span class="o">|</span> <span class="n">DT_VCENTER</span><span class="p">);</span>
</div><div class='line' id='LC161'>
</div><div class='line' id='LC162'>	<span class="n">RECT</span> <span class="n">rect2</span><span class="p">;</span>
</div><div class='line' id='LC163'>	<span class="n">rect2</span><span class="p">.</span><span class="n">left</span> <span class="o">=</span> <span class="n">rc_right_bottom</span><span class="p">.</span><span class="n">left</span><span class="p">;</span>
</div><div class='line' id='LC164'>	<span class="n">rect2</span><span class="p">.</span><span class="n">top</span> <span class="o">=</span> <span class="n">rc_right_bottom</span><span class="p">.</span><span class="n">bottom</span> <span class="o">/</span> <span class="mi">2</span> <span class="o">+</span> <span class="mi">100</span><span class="p">;</span>
</div><div class='line' id='LC165'>	<span class="n">rect2</span><span class="p">.</span><span class="n">right</span> <span class="o">=</span> <span class="n">rc_right_bottom</span><span class="p">.</span><span class="n">right</span><span class="p">;</span>
</div><div class='line' id='LC166'>	<span class="n">rect2</span><span class="p">.</span><span class="n">bottom</span> <span class="o">=</span> <span class="n">rc_right_bottom</span><span class="p">.</span><span class="n">bottom</span><span class="p">;</span>
</div><div class='line' id='LC167'>	<span class="n">TCHAR</span> <span class="n">szBuf2</span><span class="p">[</span><span class="mi">30</span><span class="p">];</span>
</div><div class='line' id='LC168'>	<span class="n">LPCTSTR</span> <span class="n">cstr2</span> <span class="o">=</span> <span class="n">TEXT</span><span class="p">(</span><span class="s">"得分：%d"</span><span class="p">);</span>
</div><div class='line' id='LC169'>	<span class="n">wsprintf</span><span class="p">(</span><span class="n">szBuf2</span><span class="p">,</span> <span class="n">cstr2</span><span class="p">,</span> <span class="n">GAME_SCORE</span><span class="p">);</span>
</div><div class='line' id='LC170'>	<span class="c1">//outPutBoxInt(sizeof(szBuf));</span>
</div><div class='line' id='LC171'><span class='c1'></span>	<span class="n">DrawTextW</span><span class="p">(</span><span class="n">hdc</span><span class="p">,</span> <span class="n">szBuf2</span><span class="p">,</span> <span class="n">_tcslen</span><span class="p">(</span><span class="n">szBuf2</span><span class="p">),</span> <span class="o">&amp;</span><span class="n">rect2</span><span class="p">,</span> <span class="n">DT_CENTER</span> <span class="o">|</span> <span class="n">DT_VCENTER</span><span class="p">);</span></span>
</div><div class='line' id='LC172'><span class='c1'></span>
</div><div class='line' id='LC173'><span class='c1'>	<span class="n">DeleteObject</span><span class="p">(</span><span class="n">hFont</span><span class="p">);</span>
</div><div class='line' id='LC174'><span class="p">}</span>
</div><div class='line' id='LC175'>
</div><div class='line' id='LC176'>
</div><div class='line' id='LC177'><span class="kt">int</span> <span class="nf">main</span><span class="p">()</span>
</div><div class='line' id='LC178'><span class="p">{</span>
</div><div class='line' id='LC179'>	<span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
</div><div class='line' id='LC180'><span class="p">}</span>
</div><div class='line' id='LC181'>
</div></pre></div>
</div>
</div>

</div>
</div>
<div class='tree_progress'></div>
<div class='ui small modal' id='modal-linejump'>
<div class='ui custom form content'>
<div class='field'>
<div class='ui right action input'>
<input placeholder='跳转至某一行...' type='number'>
<div class='ui orange button'>
跳转
</div>
</div>
</div>
</div>
</div>

<div class='row column git-project-comments' id='blob-comments'>
<input id="comment_path" name="comment_path" type="hidden" value="drawbackground.cpp" />
<input id="reply_comment_id" name="reply_comment_id" type="hidden" />
<div class='git-project-comments'>
<h3 id='project_comm_title'>
<i class='iconfont icon-comment'></i>
评论
(
<span class='comments-count'>
0
</span>
)
</h3>
<div class='ui threaded comments middle aligned' id='notes-list'></div>
<input id="ajax_add_note_id" name="ajax_add_note_id" type="hidden" />
<div class='text-center'>
<div class='tip-loading' style='display: none'>
<div class='ui active mini inline loader'></div>
正在加载...
</div>
</div>
</div>
<script>
  (function() {
    var $btnLoad, $comments, $container, $tipLoading, checkLoad, commentsCount, loadComments, page, path;
  
    page = 0;
  
    commentsCount = 0;
  
    $container = $('.git-project-comments');
  
    $comments = $container.find('.ui.comments');
  
    $tipLoading = $container.find('.tip-loading');
  
    $btnLoad = $container.find('.btn-load-more');
  
    Notes.init();
  
    if (commentsCount < 1) {
      return;
    }
  
    if ($('#comment_path').val() === '') {
      path = '/';
    } else {
      path = $('#comment_path').val();
    }
  
    loadComments = function() {
      $btnLoad.hide();
      $tipLoading.show();
      return $.ajax({
        url: '/B16041616/B16041616LiHaoMing/comment_list',
        data: {
          page: page,
          path: path
        },
        success: function(data) {
          var htmls;
  
          $tipLoading.hide();
          $btnLoad.show();
          if (data.status !== 0) {
            $btnLoad.text('无更多评论');
            return $btnLoad.prop('disabled', true).addClass('disabled');
          } else {
            htmls = data.html.replace(/[\r\n]/g, "");
            $(htmls).each(function(key, html) {
              var depth, note_ids, parentId;
  
              html = $(html).prop("outerHTML");
              if (data.comments_count < 10) {
                note_ids = $('#ajax_add_note_id').val().split(',');
                note_ids.forEach(function(val, index) {
                  if (val === $(html).attr('data-note-id')) {
                    return $('#note_' + val).closest('.children-comments').remove();
                  }
                });
              }
              parentId = $(html).attr('data-parent-id');
              depth = $(html).attr('data-depth');
              if (parentId != null) {
                return $('#note_' + parentId).append("               <div class='children-comments comments' data-deepth='" + depth + "'>                 <a class='toggle toggle-btn comment-show-toggle' href='javascript:void(0)'>                  <i class='iconfont icon-minus-circle'></i></a>" + html + "                  <div class='ui message-text hidden'></div>                </div>               ");
              } else {
                return $comments.append("<div class='comments'>" + html + "</div>");
              }
            });
            $comments.find('.timeago').timeago();
            $comments.find('.commenter-role-label').popup();
            page += 1;
            if (data.comments_count < 10) {
              $('#ajax_add_note_id').val('');
              $btnLoad.text('无更多评论');
              $btnLoad.prop('disabled', true).addClass('disabled');
            }
            noteAnchorLocater.setup();
            return toMathMlCode('', 'comments');
          }
        }
      });
    };
  
    checkLoad = function() {
      var listTop, top;
  
      top = $(window).scrollTop();
      listTop = $container.offset().top;
      if (listTop >= top && listTop < top + $(window).height()) {
        $(window).off('scroll', checkLoad);
        return loadComments();
      }
    };
  
    $btnLoad.on('click', loadComments);
  
    loadComments();
  
    this.noteAnchorLocater.init({
      lastAnchorElm: '#project_comm_title'
    });
  
  }).call(this);
</script>

</div>
<div class='inner-comment-box' id='comment-box'>
<div class='git-project-comment-form' id='project-comment'>
<img avatar="TaoEr233" class="ui avatar image" />
<div class='ui form'>
<div class='field'>
<textarea class='md-input' id='editor_comment' placeholder='在此输入你对项目想说的话...'></textarea>
</div>
<div class='ui field right aligned except-editor-textarea'>
<div class='ui orange button js-comment-button' id='only_comment'>
&emsp;评论&emsp;
</div>
<div class='ui basic button js-close-discussion-note-form' id='comment_cancel_btn'>
&emsp;取消&emsp;
</div>
</div>
</div>
</div>
<script>
  function insertText(obj,str) {
    if (document.selection) {
        var sel = document.selection.createRange();
        sel.text = str;
    } else if (typeof obj.selectionStart === 'number' && typeof obj.selectionEnd === 'number') {
        var startPos = obj.selectionStart,
            endPos = obj.selectionEnd,
            cursorPos = startPos,
            tmpStr = obj.value;
        obj.value = tmpStr.substring(0, startPos) + str + tmpStr.substring(endPos, tmpStr.length);
        cursorPos += str.length;
        obj.selectionStart = obj.selectionEnd = cursorPos;
    } else {
        obj.value += str;
    }
  }
  // 将字符串转义成正则表达式能用的字符串
  function escapeString(str) {
    var out = [];
    var keys = ['\\', '$', '(', ')', '*', '+', '.',
                '[', ']', '?', '^', '{', '}', '|'];
  
    for (var i = 0; i < str.length; ++i) {
      var ch = str.charAt(i);
      if (keys.indexOf(ch) >= 0) {
        out.push('\\');
      }
      out.push(ch);
    }
    return out.join('');
  }
  function editorKeyupHandler() {
    var commit_button = $(this).parent().next().find('.js-comment-button')
    if($.trim($(this).val()).length == 0){
      commit_button.attr('disabled','disabled').addClass('disabled');
    }else{
      commit_button.removeAttr('disabled').removeClass('disabled');
    }
  }
  
  function editorKeydownHandler(e) {
    if( (e.ctrlKey && e.keyCode == 13) || (e.metaKey && e.keyCode == 13) ){
      $(this).parent().next().find('.js-comment-button').trigger('click');
      return false;
    }else if(e.keyCode == 13){
      insertText(document.getElementById("editor_comment"),"  ");
    }
  }
  
  function replyBtnHandler(e) {
    var $input = $(this).parent().prev().find('.md-input');
    var content = $input.val();
    var replyCommentId = $(this).closest('.comment').data('note-id');
    var csrfToken = $('meta[name="csrf-token"]').attr('content');
    var users = $input.data('users');
    var $commentsCount = $('.git-project-comments .comments-count');
    var ref = $('#ref').val();
    var path = $('#comment_path').val();
    if (!jQuery.isEmptyObject(users)) {
      usersData = {}
      Object.keys(users).forEach(function(key) {
        usersData[key] = users[key];
      })
      for(var name in usersData) {
        resetKey(usersData, name, '@' + name);
      }
      Object.keys(usersData).map(function(key) {
        usersData[key] = '@' + usersData[key];
      })
      content = replaceAllName(content, usersData);
    }
    $input.val(content);
    $('.comment_send_loading').show();
    $input.attr("disabled", "disabled");
    $(this).attr("disabled","disabled").addClass("disabled");
  
    $.ajax({
      type: "POST",
      url: "/B16041616/B16041616LiHaoMing/comment",
      data: { authenticity_token: csrfToken, content: content, ref: ref, path: path, reply_comment_id: replyCommentId},
      dataType: "script"
    }).done(function(e){
      $('#note_' + replyCommentId).find('.js-note-reply').first().removeClass('disabled')
      $('#reply_comment_id').val("");
      commentsCount = parseInt($commentsCount.text()) + 1;
      $commentsCount.text(commentsCount);
      insertForm = $('#note_' + replyCommentId).find('.git-project-comment-form')
      insertForm.remove()
    }).always(function(){
      $('.comment_send_loading').hide();
      $input.removeAttr("disabled").val("");
      var comment = $('.comment.note')[0];
      if(comment && !replyCommentId){
        var offsetTop = $(comment).offset().top-80;
        $('body,html').animate({scrollTop:offsetTop},600);
        $(comment).hide().delay(10).fadeIn(1400);
      }
    });
  }
  
  $(function(){
    form = $('.git-project-comment-form');
    form.find("#comment_cancel_btn").hide();
    form.find("#only_comment").attr("disabled","disabled").addClass("disabled", "disabled").click(replyBtnHandler);
    form.find("#editor_comment").on("keyup", editorKeyupHandler).on("keydown", editorKeydownHandler);
  });
</script>

</div>
</div>
</div>
</div>
</div>
<script>
  (function() {
    $(function() {
      return Tree.init();
    });
  
  }).call(this);
</script>

<script>
  Tree.initHighlightTheme('white')
</script>
<script>
  $(function() {
    GitLab.GfmAutoComplete.dataSource = "/B16041616/B16041616LiHaoMing/autocomplete_sources"
    GitLab.GfmAutoComplete.Emoji.assetBase = '/assets/emoji'
    GitLab.GfmAutoComplete.setup();
  });
</script>

<footer id='git-footer-main'>
<div class='ui container'>
<div class='ui two column grid'>
<div class='column'>
<p><a href="https://gitee.com/" target="_blank">© Gitee.com  </a></p>
<div class='ui three column grid' id='footer-left'>
<div class='column'>
<div class='ui link list'>
<div class='item'>
<a href="/terms" class="item">使用条款</a>
</div>
<div class='item'>
<a href="http://git.mydoc.io" class="item">帮助文档</a>
</div>
<div class='item'>
<a href="/api/v5/swagger" class="item">OpenAPI</a>
</div>
</div>
</div>
<div class='column'>
<div class='ui link list'>
<div class='item'>
<a href="https://gitee.com/gitee-stars/" class="item">码云封面人物</a>
</div>
<div class='item'>
<a href="/appclient" class="item">APP与插件下载</a>
</div>
<div class='item'>
<a href="/links.html" class="item">合作伙伴</a>
</div>
</div>
</div>
<div class='column'>
<div class='ui link list'>
<div class='item'>
<a href="https://gitee.com/git-osc/" class="item">更新日志</a>
</div>
<div class='item'>
<a href="/oschina/git-osc/issues/new" class="item">意见与建议</a>
</div>
</div>
</div>
</div>
</div>
<div class='column right aligned followus'>
<div class='qrcode weixin'>
<p class='weixin-text'>微信公众号</p>
<img alt="Qrcode-weixin" src="/assets/qrcode-weixin-8ab7378f5545710bdb3ad5c9d17fedfe.jpg" />
</div>
<div class='phone-and-qq column'>
<div class='ui list'>
<div class='item'>
400-898-2008 转2
</div>
<div class='item' id='git-footer-email'>
git#oschina.cn
</div>
<div class='item qq-and-weibo'>
<a href="//shang.qq.com/wpa/qunwpa?idkey=0d6c2fc0b5b71ac33405dd575bb490bf1a50e3c9a9f694e8a689cb59ee7dacc3" class="icon-popup" title="点击加入码云官方三群"><i class='iconfont icon-logo-qq'></i>
<span>三群：655903986</span>
</a><a href="http://weibo.com/mayunOSC" class="icon-popup" target="_blank" title="关注码云微博"><i class='iconfont icon-logo-weibo'></i>
<span>码云Gitee</span>
</a></div>
</div>
</div>
</div>
</div>
</div>
<div class='bottombar'>
<div class='ui container'>
<div class='ui grid'>
<div class='five wide column partner'>
本站带宽由 <a href="https://www.anchnet.com/" target="_blank" title="anchnet"><img alt="51idc" src="/51idc.png" /></a> 提供
</div>
<div class='eleven wide column right aligned'>
<div class='copyright'>
<a href="http://www.miitbeian.gov.cn/">粤ICP备12009483号-8</a>
深圳市奥思网络科技有限公司版权所有
</div>
<i class='icon world'></i>
<a href="/language/zh-CN">简 体
</a>/
<a href="/language/zh-TW">繁 體
</a>/
<a href="/language/en">English
</a></div>
</div>
</div>
</div>
</footer>
<script>
  function force_mobile() {
    current_url = window.location.href;
    force_mobile_url = current_url.substr(0,current_url.indexOf('?'))+'?force_mobile=true';
    location.href = force_mobile_url;
  }
  (function () {
    // 更新底栏的位置，当页面内容高度小于窗口高度时，会将底栏浮动定位在窗口底端
    function updateFooterPosition() {
      var pageHeight = document.body.offsetHeight;
      if ($footer.hasClass('fixed-bottom')) {
        pageHeight += $footer.outerHeight();
        if (pageHeight > $(window).height()) {
          $footer.removeClass('fixed-bottom');
        }
      } else {
        if (pageHeight < $(window).height()) {
          $footer.addClass('fixed-bottom');
        }
      }
    }
    var $footer = $('#git-footer-main');
    $(document).on('ready', updateFooterPosition);
    $(window).on({
      'scroll': updateFooterPosition,
      'resize': updateFooterPosition
    });
    // 每隔一段时间检测页面高度变化，确保底栏能在页面最底端
    setInterval(updateFooterPosition, 500);
    var email = $('#git-footer-email').text();
    $('#git-footer-email').text(email.replace('#', '@'));
  })();
  $('.icon-popup').popup({ position: 'bottom center' });
</script>
<div class='side-toolbar'>
<div class='button share-link'>
<i class='iconfont icon-share'></i>
</div>
<div class='ui popup'>
<div class='header'>
分享到
</div>
<div class='bdsharebuttonbox'>
<a class='item bds_weixin' data-cmd='weixin' title='分享到微信'>weixin</a>
<a class='item bds_tsina' data-cmd='tsina' title='分享到新浪微博'>sina</a>
<a class='item bds_sqq' data-cmd='sqq' title='分享到QQ好友'>qq</a>
<a class='item bds_qzone' data-cmd='qzone' title='分享到QQ空间'>qzone</a>
</div>
</div>
<div class='popup button' data-content='给项目拥有者发送私信' id='project-user-message'>
<i class='iconfont icon-message'></i>
</div>
<div class='popup button' data-content='评论' id='home-comment'>
<i class='iconfont icon-comment'></i>
</div>
<div class='button gotop popup' data-content='回到顶部' id='gotop'>
<i class='iconfont icon-top'></i>
</div>
</div>
<div class='ui modal message-input'>
<i class='close icon'></i>
<div class='header'>给用户发送私信</div>
<div class='content'>
<textarea class='message-content' maxlength='250' placeholder='请在这里输入私信内容' style='padding:1em;width:100%;resize:none;'></textarea>
</div>
<div class='actions'>
<div class='ui orange right labeled icon button ok' id='send-message'>
发送
<i class='checkmark icon'></i>
</div>
<div class='ui button basic cancel'>
取消
</div>
</div>
</div>
<script>
  (function() {
    var sendMessage;
  
    $('#project-user-message').popup({
      position: 'left center'
    });
  
    $('body').delegate('#project-user-message, #show_send_msg_btn', 'click', function() {
      $('.message-content').val('');
      return $('.message-input').modal({
        onApprove: function() {
          return sendMessage("");
        }
      }).modal('show');
    });
  
    $('body').delegate('.set-msg-content', 'click', function() {
      return $('.message-content').val('想请您喝杯咖啡，请您开启项目捐赠功能吧。');
    });
  
    $('.message-content').on('keydown', function(e) {
      if ((e.ctrlKey && e.keyCode === 13) || (e.metaKey && e.keyCode === 13)) {
        $('#send-message').trigger('click');
        return false;
      }
    });
  
    sendMessage = function(e) {
      var content, username;
  
      content = $('.message-content').val();
      if ($.trim(content).length === 0) {
        alert("请输入私信内容");
        return false;
      } else {
        username = gon.message;
        return $.ajax({
          url: "/" + username + "/message",
          beforeSend: function(xhr) {
            xhr.setRequestHeader('X-CSRF-Token', $('meta[name="csrf-token"]').attr('content'));
          },
          type: 'POST',
          data: {
            content: content
          },
          success: function(data) {
            if (data.status === 0) {
              return alert("可能由于发送过于频繁，留言发送失败，请稍后再试");
            } else {
              $('#project-ok-msg').fadeIn();
              return setTimeout(function() {
                return $('#project-ok-msg').fadeOut('2500');
              }, 1500);
            }
          },
          error: function() {
            return alert("可能由于网络原因，留言发送失败，请稍后再试");
          }
        });
      }
    };
  
  }).call(this);
</script>
<script>
  (function() {
    var $gotop, $root, $toolbar, update;
  
    $root = $('body, html');
  
    $toolbar = $('.side-toolbar');
  
    $gotop = $('#gotop').popup({
      position: 'left center'
    }).on('click', function() {
      return $root.animate({
        scrollTop: 0
      }, 500);
    });
  
    update = function() {
      if ($(window).scrollTop() > 50) {
        return $gotop.addClass('active');
      } else {
        return $gotop.removeClass('active');
      }
    };
  
    $(window).on('scroll', update);
  
    update();
  
    $toolbar.find('.share-link').popup({
      inline: true,
      hoverable: true,
      position: 'left center',
      delay: {
        hide: 500
      }
    });
  
  }).call(this);
</script>
<script>
  (function() {
    var $comment, $root;
  
    $root = $('body, html');
  
    $comment = $('#home-comment').popup({
      position: 'left center'
    });
  
    $comment.on('click', function() {
      var comment, href, offsetTop;
  
      if ($('#project_comm_title').length === 0) {
        href = '/B16041616/B16041616LiHaoMing#project_comm_title';
        window.location.href = href;
        return;
      }
      comment = $('.comment.note')[0];
      if (comment) {
        offsetTop = $(comment).offset().top - 80;
        return $root.animate({
          scrollTop: offsetTop
        }, 400);
      } else {
        offsetTop = $('#editor_comment').offset().top + 30;
        $root.animate({
          scrollTop: offsetTop
        }, 400);
        return $('#editor_comment').focus();
      }
    });
  
  }).call(this);
</script>
<script>
  window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"分享到新浪微博","bdMini":"1","bdMiniList":["bdxc","tqf","douban","bdhome","sqq","thx","ibaidu","meilishuo","mogujie","diandian","huaban","duitang","hx","fx","youdao","sdo","qingbiji","people","xinhua","mail","isohu","yaolan","wealink","ty","iguba","fbook","twi","linkedin","h163","evernotecn","copy","print"],"bdPic":"","bdStyle":"1","bdSize":"32"},"share":{}};
</script>
<script src="/bd_share/static/api/js/share.js" type="text/javascript"></script>



<script>
  (function() {
    this.__gac = {
      domain: 'www.oschina.net'
    };
  
  }).call(this);
</script>
<script defer src='//www.oschina.net/public/javascripts/cjl/ga.js?t=20160926' type='text/javascript'></script>

</body>
</html>
